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

# Chat & Responses

> Generate text through OpenAI-compatible and Anthropic-compatible AI Gateway routes.

Use the request format your application already understands. The format does not determine the underlying provider: an OpenAI-compatible request can still target a supported Claude, Gemini, Qwen, or other model.

| Format                  | Route                       | Best for                                   |
| ----------------------- | --------------------------- | ------------------------------------------ |
| OpenAI Chat Completions | `POST /v1/chat/completions` | Existing OpenAI SDK integrations           |
| OpenAI Responses        | `POST /v1/responses`        | New OpenAI-style applications and tool use |
| Anthropic Messages      | `POST /v1/messages`         | Existing Anthropic SDK integrations        |
| Native Anthropic        | `/anthropic/v1/*`           | Anthropic-specific endpoints or semantics  |

## OpenAI-Compatible Chat

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import OpenAI from "openai";

    const client = new OpenAI({
      baseURL: "https://api.inquantum.ai/v1",
      apiKey: process.env.PLANCK_API_KEY,
    });

    const response = await client.chat.completions.create({
      model: "gpt-4o-mini",
      messages: [
        { role: "user", content: "Explain vector search in one sentence." },
      ],
    });

    console.log(response.choices[0].message.content);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os
    from openai import OpenAI

    client = OpenAI(
        base_url="https://api.inquantum.ai/v1",
        api_key=os.environ["PLANCK_API_KEY"],
    )

    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "Explain vector search in one sentence."}],
    )

    print(response.choices[0].message.content)
    ```
  </Tab>

  <Tab title="cURL">
    ```bash theme={null}
    curl https://api.inquantum.ai/v1/chat/completions \
      -H "Authorization: Bearer $PLANCK_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "gpt-4o-mini",
        "messages": [
          {"role": "user", "content": "Explain vector search in one sentence."}
        ]
      }'
    ```
  </Tab>
</Tabs>

Set `stream: true` to receive server-sent events. See [Chat Completions](/rest/ai-gateway/post-v1-chat-completions) for the complete request reference.

## Responses API

```bash theme={null}
curl https://api.inquantum.ai/v1/responses \
  -H "Authorization: Bearer $PLANCK_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-4o-mini",
    "input": "Explain vector search in one sentence."
  }'
```

See [Responses API](/gateway/concepts/responses-api) for supported request behavior.

## Anthropic-Compatible Messages

The mapped Messages route accepts Anthropic-style inputs and returns an Anthropic-style response while retaining gateway routing, billing, and observability.

```bash theme={null}
curl https://api.inquantum.ai/v1/messages \
  -H "Authorization: Bearer $PLANCK_API_KEY" \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{
    "model": "claude-4.5-sonnet",
    "max_tokens": 256,
    "messages": [
      {"role": "user", "content": "Explain vector search in one sentence."}
    ]
  }'
```

Use [`/anthropic/v1/*`](/rest/ai-gateway/anthropic-native) only when you need a native Anthropic path that is not covered by the mapped Messages route.

## Observability

Successful and failed generations appear in **Requests** with their model, provider, tokens, duration, cost, user, custom properties, and response status. Add your own user, session, or property headers when you need application-level attribution.

<Card title="Configure routing and BYOK" icon="route" href="/gateway/provider-routing">
  Choose providers, supply provider keys, and configure fallbacks.
</Card>
