> ## 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.

# Responses API

> Use the OpenAI Responses API format through Planck AI Gateway with your Planck API key

## Quick Start

Use your Planck API key and the AI Gateway base URL. Then call the OpenAI SDK's `responses.create` method as usual.

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

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

  const response = await client.responses.create({
    model: "gpt-5",
    input: "Write a one-sentence bedtime story about a unicorn.",
  });

  console.log(response.output_text);
  ```

  ```python Python theme={null}
  import os
  from openai import OpenAI

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

  response = client.responses.create(
      model="gpt-5",
      input="Write a one-sentence bedtime story about a unicorn.",
  )

  print(response.output_text)
  ```

  ```bash curl theme={null}
  curl https://api.inquantum.ai/v1/responses \
    -H "Authorization: Bearer $PLANCK_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "gpt-5",
      "input": "Write a one-sentence bedtime story about a unicorn."
    }'
  ```
</CodeGroup>

<Note>
  For Chat Completions usage and more background on the AI Gateway, see the
  [AI Gateway Overview](/gateway/overview).
</Note>

## Streaming

The gateway supports OpenAI-compatible Responses API requests, including streaming for supported routes and providers. Use the same `stream: true` request shape that the OpenAI SDK expects.

## Provider Mapping

Responses requests are normalized through the gateway pipeline so they can use Planck routing, billing, logging, and provider mapping. When a request is routed to a non-OpenAI provider, the gateway maps the request and response into the closest compatible shape.

For custom targets, `POST /v1/responses` is BYOK-only and requires the target to be configured for your organization or enabled as a local development target.

## References

* OpenAI Responses guide: [https://platform.openai.com/docs/guides/text](https://platform.openai.com/docs/guides/text)
* Planck AI Gateway overview: [https://docs.inquantum.ai/gateway/overview](https://docs.inquantum.ai/gateway/overview)
