# GPT-6.2 Astra

Use `gpt-6.2-astra` for complex coding and document analysis. Set the OpenAI SDK's base URL to `https://api.seedrouter.ai/v1` and supply your SeedRouter API key.

## Model and limits

| Property         | GPT-6.2 Astra                       |
| ---------------- | ----------------------------------- |
| Request model ID | `gpt-6.2-astra`                     |
| Input and output | Text and images in, text out        |
| Context window   | 1,050,000 tokens                    |
| Maximum input    | 922,000 tokens                      |
| Maximum output   | 128,000 tokens, including reasoning |
| Knowledge cutoff | May 18, 2026                        |

The context window covers input and output together. Choose an output limit that leaves room for both reasoning and the visible answer. Current per-token rates and long-context pricing appear on the [model page](https://seedrouter.ai/models/gpt-6-2-astra#pricing).

## Responses

Install the Python `openai` package and set `SEEDROUTER_API_KEY` in your environment.

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["SEEDROUTER_API_KEY"],
    base_url="https://api.seedrouter.ai/v1",
    max_retries=0,
)
response = client.responses.create(
    model="gpt-6.2-astra",
    input="Name one consistency check for a double-entry ledger.",
    reasoning={"effort": "low"},
    max_output_tokens=256,
)
print(response.output_text)
```

On the wire, send `POST /v1/responses`. Read text from `output` items of type `message`, in content parts of type `output_text`. An earlier item can contain reasoning or a function call. `output_text` on the Python SDK response gathers the text parts for you. Check `status` and `incomplete_details` before using a partial result.

To send an image, include an `input_image` part in a user message. Omit the top-level `image` field. SeedRouter accepts synchronous and streaming responses. Omit `background_options` and leave `background` unset. The `2h` and `8h` background windows are unavailable.

For hosted subagents, send the header `OpenAI-Beta: responses_multi_agent=v1` and the `multi_agent` object with `enabled` set to true. The optional integer `max_concurrent_subagents` counts active descendants, excludes the root agent, and defaults to 3 with a minimum of 1. Omit `reasoning.summary` and `max_tool_calls` while delegation is enabled. Subagents share the output budget. To read the final answer, select message items whose `agent.agent_name` is `/root` and whose `phase` is `final_answer`. The Playground supplies the beta header when you enter the object in advanced JSON.

```bash
curl https://api.seedrouter.ai/v1/responses \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -H "OpenAI-Beta: responses_multi_agent=v1" \
  -d '{
    "model": "gpt-6.2-astra",
    "input": "Ask one subagent to check whether 17 is prime. Give the result.",
    "multi_agent": {"enabled": true, "max_concurrent_subagents": 1},
    "max_output_tokens": 512
  }'
```

## Chat Completions

```bash
curl https://api.seedrouter.ai/v1/chat/completions \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.2-astra",
    "messages": [{"role": "user", "content": "Name one consistency check for a double-entry ledger."}],
    "reasoning_effort": "low",
    "max_completion_tokens": 256
  }'
```

A completed Chat reply contains `choices[0].message.content`. Inspect `choices[0].finish_reason` for output limits. Chat reports `usage.prompt_tokens` and `usage.completion_tokens`. Responses reports `usage.input_tokens` and `usage.output_tokens`.

## Request fields by endpoint

| Intent                  | Responses                                                       | Chat Completions                                         |
| ----------------------- | --------------------------------------------------------------- | -------------------------------------------------------- |
| Input                   | `input` string or input items                                   | `messages` array                                         |
| Developer instructions  | `instructions` for this request, or a `developer` input message | A `developer` message                                    |
| Image in a user message | Part of type `input_image` with a string `image_url`            | Part of type `image_url` with the URL in `image_url.url` |
| Reasoning effort        | `reasoning.effort`                                              | `reasoning_effort`                                       |
| Output token budget     | `max_output_tokens`                                             | `max_completion_tokens`                                  |
| Output detail           | `text.verbosity`                                                | `verbosity`                                              |
| Strict JSON             | `text.format`                                                   | `response_format.json_schema`                            |
| Function calls          | `tools`, `tool_choice`, `function_call_output`                  | Use Responses for GPT-6.2 tool calls                     |
| Streaming               | `stream: true`, typed events                                    | `stream: true`, Chat completion chunks                   |

OpenAI recommends starting with `medium` reasoning for a new integration. Use `low` for a short answer. When migrating from `none` or `minimal`, choose `low`. Omit `temperature`, `top_p` and log-probability controls, including `message.output_text.logprobs` in Responses `include`. [Model migration guide](https://developers.openai.com/api/docs/guides/latest-model/gpt-6.2-astra#migration-quickstart)

## Structured output

A Responses JSON Schema format puts `name`, `strict` and `schema` alongside `type`. In Chat the same three fields go inside `response_format.json_schema`.

```python
city_format = {
    "name": "trip",
    "strict": True,
    "schema": {
        "type": "object",
        "properties": {"city": {"type": "string"}},
        "required": ["city"],
        "additionalProperties": False,
    },
}
response = client.responses.create(
    model="gpt-6.2-astra",
    input="Return Paris in the city field.",
    text={"format": {"type": "json_schema", **city_format}},
    reasoning={"effort": "low"},
    max_output_tokens=256,
)
print(response.output_text)
```

To use the schema with Chat Completions, pass `response_format={"type": "json_schema", "json_schema": city_format}`. Check the reply for a refusal or a token limit before parsing the JSON.

## Function calls and streaming

In a Responses request, the function's `name` and `parameters` sit directly on the tool. This example reuses the schema above.

```python
response = client.responses.create(
    model="gpt-6.2-astra",
    input="Call record_city for Paris.",
    tools=[{
        "type": "function",
        "name": "record_city",
        "parameters": city_format["schema"],
        "strict": True,
    }],
    tool_choice={"type": "function", "name": "record_city"},
    reasoning={"effort": "low"},
    max_output_tokens=256,
)
for item in response.output:
    if item.type == "function_call":
        print(item.call_id, item.name, item.arguments)
```

In a live SeedRouter test, this request returned a `function_call` named `record_city` with arguments that decoded to `{"city":"Paris"}`. Validate the arguments and execute your function in your application. In the next Responses request, carry the original input and returned output items forward and append a `function_call_output` item with the matching `call_id` and a string `output`.

For live text, set `stream: true`. In Responses, concatenate `delta` from `response.output_text.delta` events and check for `response.completed`, `response.incomplete` or `response.failed`. In Chat, collect `choices[].delta.content`, check the final finish reason, and read until `[DONE]`.

## Access and pricing

Check your key's access with `GET /v1/models`. For available groups, use `GET /api/seedrouter/llm/groups?model=gpt-6.2-astra` with the same Bearer key. To select one of the returned groups, send its ID in the optional `X-SeedRouter-Group` header. Omitting the header uses the key's default selection. You can also inspect available groups in the [Playground](https://seedrouter.ai/models/gpt-6-2-astra#playground).

[OpenAPI download](https://seedrouter.ai/docs/gpt-6-2-astra.openapi.json) · [OpenAI model details](https://developers.openai.com/api/docs/models/gpt-6.2-astra) · [Responses fields](https://developers.openai.com/api/reference/resources/responses/methods/create) · [Chat fields](https://developers.openai.com/api/reference/resources/chat/subresources/completions/methods/create) · [Error codes](https://seedrouter.ai/docs/api/errors)
