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

# OpenAI Responses

> Call GPT models with the OpenAI Responses protocol: text and image input, reasoning effort, streaming events, function calling and structured output.

Responses is OpenAI's newer interface for the GPT family: the input is a string or a list of messages, images and tool results, and the output is a list of typed items (messages, reasoning, function calls). Reasoning models work best here and the streaming events are finer-grained. The OpenAI SDKs connect by changing `base_url`.

## Models

The GPT-6 family is organised in tiers: Astra is the most capable, Sol is the flagship workhorse, Terra balances intelligence and cost, and Luna is the fastest and cheapest. Every model takes text and image input, returns text, and lets you tune reasoning with `reasoning_effort` (`reasoning.effort` in Responses).

| Model ID | Introduction | Context window | Max output |
| - | - | - | - |
| `gpt-6.2-astra` | The Astra tier of GPT-6.2, the most capable tier of the GPT-6 family. | — | — |
| `gpt-6.2-sol` | The Sol tier of GPT-6.2, the flagship workhorse of the GPT-6 family. | — | — |
| `gpt-6.1-terra` | A fast, efficient model for visual reasoning, precise computer use and clear, natural writing. | 1,050,000 | 128,000 |
| `gpt-6-luna` | OpenAI's most efficient model, for focused, high-volume tasks. | 1,050,000 | 128,000 |

Context window and max output are in tokens, as published by each model's vendor.

The full list with prices is in the [model catalog](https://www.dreamto.ai/models); `GET /v1/models` lists the models your API Key can use.

## Endpoints

| Endpoint | Purpose |
| - | - |
| [`POST /v1/responses`](https://docs.dreamto.ai/en/api-reference/openai-responses/create-response) | Create a model response |

The base URL is `https://api.dreamto.ai`. Create an API Key in the [DreamTo console](https://www.dreamto.ai); see [Authentication](https://docs.dreamto.ai/en/authentication.md).

## Quick start

```bash cURL theme={null}
curl "https://api.dreamto.ai/v1/responses" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.2-sol",
    "input": "Explain quantum computing in three sentences."
  }'
```

```python Python theme={null}
import os

from openai import OpenAI

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

response = client.responses.create(
    model="gpt-6.2-sol",
    input="Explain quantum computing in three sentences.",
)
print(response.output_text)
```

```javascript Node.js theme={null}
import OpenAI from "openai";

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

const response = await client.responses.create({
  model: "gpt-6.2-sol",
  input: "Explain quantum computing in three sentences.",
});
console.log(response.output_text);
```

## Streaming

Add `"stream": true` and the reply arrives as typed server-sent events: `response.created`, `response.output_text.delta` … and finally `response.completed`, which carries the complete Response object and `usage`.

```python Python theme={null}
stream = client.responses.create(
    model="gpt-6.2-sol",
    input="Write a four-line poem about autumn.",
    stream=True,
)
for event in stream:
    if event.type == "response.output_text.delta":
        print(event.delta, end="")
```

## Notes

* Only the create endpoint `POST /v1/responses` is available. Retrieving, deleting or cancelling a response, and the `input_tokens` and `compact` endpoints, are not provided, so send the whole conversation in `input` with every request instead of relying on `previous_response_id`, `conversation` or `background`.
* For multi-turn reasoning, pass the items of the previous `output` (including `reasoning`) back in the next `input` unchanged.
* Use function calling (`type: function`) for tools. Built-in tools hosted by OpenAI, such as web search, file search, code interpreter and computer use, are not guaranteed to be available.
* Errors use one common structure, see [Errors](https://docs.dreamto.ai/en/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.