# Chat Completions, Anthropic Messages or Responses API on LLM API

LLM API's agent storefront accepts three request formats: OpenAI-compatible Chat Completions, Anthropic-native Messages and the OpenAI Responses API. Every one of its 12 chat models answers on all three by its model id, so you can keep the format your code already sends and change only `model`. Each call is charged for the input and output tokens it actually uses at the model's rate, such as $1.90 per million tokens for Claude Sonnet 5 input, and draws on Prepaid credit (minimum $0.50) through `Authorization: Bearer <token>`, with `"stream": false`.

## At a glance

- **Endpoints:** `POST https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/chat/completions`, `POST https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/messages`, `POST https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/responses`
- **Body:** Chat Completions takes `model`, `messages` and `max_tokens`. Messages takes `model`, `messages` and `max_tokens`, and all three are required. Responses takes `model`, `input` and `max_output_tokens`. Never request streaming: set `"stream": false` on Chat Completions and Messages.
- **Models:** the same 12 model ids on all three endpoints
- **Price:** the input and output tokens a call actually uses, at the model's rate. The rate is the same on every endpoint.
- **Payment:** calls draw down Prepaid credit, minimum $0.50 or $0.50 by card. You buy it with an agent credential over x402, MPP or card. A call cannot be paid on its own.
- **Response:** one JSON body in the format you sent. The `zc-billing` header reports what the call drew.
- **Limits:** no streaming. Responses background mode is rejected.
- **Full purchase flow:** [the buyer skill](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/SKILL.md)

## Choose the request format your code already sends

| Request format your code sends | Endpoint | Prompt field | Output ceiling |
| --- | --- | --- | --- |
| OpenAI-style chat completions (`messages` list) | `/zc/v1/chat/completions` | `messages` | `max_tokens`, optional |
| Anthropic Messages API shape | `/zc/v1/messages` | `messages` | `max_tokens`, required |
| OpenAI Responses API | `/zc/v1/responses` | `input`, a string | `max_output_tokens`, optional |

Every chat model id is accepted on all three endpoints, so the format you choose does not limit which models you can reach.

## Send one question in each format

1. Hold an agent credential with Prepaid credit. The [buyer skill](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/SKILL.md) covers registering the credential and buying credit.

2. Chat Completions, here with a Claude model:

   ```bash
   curl -s https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/chat/completions \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"model": "claude-sonnet-5", "messages": [{"role": "user", "content": "In one sentence, what does an HTTP 402 Payment Required response mean?"}], "max_tokens": 120, "stream": false}'
   ```

   The response is in OpenAI's chat completion shape: the reply is in `choices[0].message.content` and the token counts are in `usage`.

3. Anthropic Messages:

   ```bash
   curl -s https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/messages \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"model": "claude-sonnet-5", "max_tokens": 120, "messages": [{"role": "user", "content": "In one sentence, what does an HTTP 402 Payment Required response mean?"}], "stream": false}'
   ```

   The reply is in `content[0].text`, and the token counts are in `usage`. An excerpt of the example response:

   ```json
   {
     "type": "message",
     "role": "assistant",
     "model": "claude-sonnet-5",
     "content": [{"type": "text", "text": "HTTP 402 Payment Required is a status code reserved for future use, intended to …"}],
     "stop_reason": "end_turn",
     "usage": {"input_tokens": 31, "output_tokens": 67}
   }
   ```

   This example drew $0.000696 from prepaid credit.

4. Responses API:

   ```bash
   curl -s https://agents.llmapi.ai/zcj/ao3paiwhcf0o/zc/v1/responses \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"model": "gpt-5-mini", "input": "In one sentence, what does an HTTP 402 Payment Required response mean?", "max_output_tokens": 300}'
   ```

   The response has `"object": "response"` and a `status` of `completed`. `output` is a list: on `gpt-5-mini` the first item has `type` `reasoning`, and the reply follows it. An excerpt of the usage:

   ```json
   "usage": {"input_tokens": 21, "output_tokens": 189, "output_tokens_details": {"reasoning_tokens": 128}, "total_tokens": 210}
   ```

   In this example, the 189 output tokens included 128 reasoning tokens. A Responses call to `gpt-5-mini` with `max_output_tokens` at 300 drew $0.000364 from prepaid credit.

5. Read the `zc-billing` header for the actual debit. It has the shape `{"status": "settled", "fundingSource": "credit", "chargedUsd": "<debit>", "remainingCreditUsd": "<balance>"}`.

## Model ids for every format

Send the id exactly as written. A service slug such as `gpt-5-1` is not a valid `model` value.

| Model | `model` | Context | Input | Output |
| --- | --- | --- | --- | --- |
| Claude Opus 5 | `claude-opus-5` | 1M | $4.75 per million tokens | $23.75 per million tokens |
| Claude Sonnet 5 | `claude-sonnet-5` | 1M | $1.90 per million tokens | $9.50 per million tokens |
| GPT-5.2 | `gpt-5.2` | 400K | $1.6625 per million tokens | $13.30 per million tokens |
| GPT-5.1 | `gpt-5.1` | 400K | $1.1875 per million tokens | $9.50 per million tokens |
| GPT-5 Mini | `gpt-5-mini` | 400K | $0.2375 per million tokens | $1.90 per million tokens |
| Gemini 3.1 Pro (Preview) | `gemini-3.1-pro-preview` | 1M | $1.90 per million tokens | $11.40 per million tokens |
| Gemini 3.7 Flash | `gemini-3.7-flash` | 1M | $0.7125 per million tokens | $3.5625 per million tokens |
| DeepSeek V4 Pro | `deepseek-v4-pro` | 1M | $1.653 per million tokens | $3.306 per million tokens |
| DeepSeek V4 Flash | `deepseek-v4-flash` | 1M | $0.1805 per million tokens | $0.4845 per million tokens |
| Grok 4.6 | `grok-4.6` | 500K | $1.90 per million tokens | $5.70 per million tokens |
| Kimi K2.6 | `kimi-k2.6` | 262K | $0.9025 per million tokens | $3.80 per million tokens |
| GLM 5.3 | `glm-5.3` | 1M | $1.33 per million tokens | $4.18 per million tokens |

The model and the token counts set the cost, not the endpoint. For example, 2,000 input tokens and 500 output tokens cost $0.00855 on `claude-sonnet-5` and $0.001425 on `gpt-5-mini`.

## Limits

- No streaming. `stream` must be `false` or omitted, and streaming requests are rejected.
- The Responses API is synchronous only. Background mode is rejected.
- The embeddings models answer only on `/zc/v1/embeddings`, not on these three endpoints.
- No call is paid on its own. Every call draws on prepaid credit, and a call deducts only its actual tokens.
- After a call is proxied, the upstream API's own status code and body come back, including its errors.

## Errors

| Code | Meaning | Action |
| --- | --- | --- |
| `401 bearer_required` | No agent credential on the call | Register one ([auth.md](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/auth.md)), then retry with `Authorization: Bearer <token>` |
| `401 invalid_token` | The credential did not verify or expired | Exchange the stored assertion for a fresh token |
| `403 plan_required` | The credential holds no credit that covers the call | Buy Prepaid credit from the `plans` in the body, then retry |
| `usage_exhausted` | The credit balance ran out | Top up with `POST https://agents.llmapi.ai/zcj/ao3paiwhcf0o/extend` and `{"amountUsd": "..."}` |
| `invalid_request` | The request body is malformed | Fix the JSON |

## Frequently asked questions

### Can I call Claude with the OpenAI chat completions format?

Yes. Send `"model": "claude-sonnet-5"` or `"claude-opus-5"` to `/zc/v1/chat/completions` with an OpenAI-style `messages` list and `"stream": false`. The same ids also work on `/zc/v1/responses`.

### Does the Anthropic Messages endpoint accept GPT, Gemini and other models?

Yes. `/zc/v1/messages` accepts all 12 chat model ids, including `gpt-5-mini`, `gemini-3.7-flash` and `deepseek-v4-flash`, in the Anthropic request shape with `max_tokens` required.

### Does the request format change the price?

No. Each call is charged for the input and output tokens it actually uses at the model's rates, and the rates are the same on Chat Completions, Messages and the Responses API.

### Does LLM API's storefront stream responses?

No. Every response comes back as one JSON body. Set `stream` to `false` or leave it out.

### Can I pay for a single call without buying credit?

No. Calls draw on Prepaid credit held by an agent credential, with a minimum purchase of $0.50. Unused credit stays on the balance for later calls.

## Keep reading

- [Buyer skill](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/SKILL.md): the full purchase flow
- [API reference](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/openapi.json): the exact request schemas
- [Catalog](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/manifest.json): live models, plans and prices
- [How to pay](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/payment.md): credit, rails and top-ups
- [Error reference](https://agents.llmapi.ai/zcj/ao3paiwhcf0o/errors.md): every error code

---

Updated 2026-10-28. All LLM API guides: https://agents.llmapi.ai/guides.md. Storefront: https://agents.llmapi.ai/zcj/ao3paiwhcf0o/llms.txt.
