> ## Documentation Index
> Fetch the complete documentation index at: https://docs.b3iq.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a native coding client with Anthropic Messages.

Supports text conversation history, client-executed tool calls/results and incremental streaming. Uses dashboard keys and permitted owned machines. Anthropic does not officially support non-Claude gateway models; API-format compatibility does not establish model behavior. Image/document input is unavailable here; media generation uses the B3IQ media MCP. Request bodies are limited to 1 MiB. 

` POST /v1/api/messages `

Run a native coding client with Anthropic Messages.

Supports text conversation history, client-executed tool calls/results
and incremental streaming. Uses dashboard keys and permitted owned
machines. Anthropic does not officially support non-Claude gateway
models; API-format compatibility does not establish model behavior.
Image/document input is unavailable here; media generation uses the
B3IQ media MCP. Request bodies are limited to 1 MiB.


## Servers

- ` https://b3iq.org ` — Public hosted gateway facade.

## Authentication

The operation accepts these alternatives. Schemes within one alternative are required together.

### Alternative 1

- ` HostedGatewayBearer `: ` http `

  - HTTP scheme: ` bearer ` (b3iq_gateway)

  - Scoped hosted gateway key. `gateway:chat` is required for chat; `gateway:models` is optional for the own-machines-scoped model list.

## Parameters

### ` x-b3iq-node-id ` (header, optional)

Optional permitted owned-machine pin. Competing pins must agree.

- ` value `: type ` string `

## Request body (required)

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` model `, ` messages `, ` max_tokens `

  - ` model `: type ` string `

  - ` messages `: type ` array `

    - ` array item `: type ` object `

  - ` system `: type ` unknown `

    - ` oneOf alternative 1 `: type ` string `

    - ` oneOf alternative 2 `: type ` array `

      - ` array item `: type ` object `

  - ` tools `: type ` array `

    - ` array item `: type ` object `

  - ` stream `: type ` boolean `

  - ` max_tokens `: type ` integer `

    - minimum: ` 1 `

## Responses

### ` 200 ` — A Messages object or incremental Messages event stream.

Content type: ` application/json `

- ` value `: type ` object `

### ` default ` — An Anthropic-shaped error; status identifies auth, scope, size, quota or upstream failures.

Content type: ` application/json `

- ` value `: type ` object `

  - Required fields: ` type `, ` error `

  - ` type `: type ` unknown `

  - ` error `: type ` object `

    - Required fields: ` type `, ` message `

    - ` type `: type ` string `

    - ` message `: type ` string `

## Request examples

### cURL

```curl
curl -X POST 'https://b3iq.org/v1/api/messages' \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "string",
  "messages": [
    {}
  ],
  "system": "string",
  "tools": [
    {}
  ],
  "stream": true,
  "max_tokens": 1
}'
```

### JavaScript

```javascript
const response = await fetch('https://b3iq.org/v1/api/messages', {
  method: 'POST',
  headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "model": "string",
    "messages": [
      {}
    ],
    "system": "string",
    "tools": [
      {}
    ],
    "stream": true,
    "max_tokens": 1
  })
});

const data = await response.json();
console.log(data);
```