# GPT Terra 6.1 API (https://wanapi.app/docs/gpt-6-1-terra)





Use **GPT Terra 6.1** with the OpenAI Responses or Chat Completions format and your Wan API key. [Compare GPT models](/docs/gpt-api).

## Model settings [#model-settings]

| Setting          | GPT Terra 6.1                                   |
| ---------------- | ----------------------------------------------- |
| Request model ID | `gpt-6.1-terra`                                 |
| Input / output   | Text and images / text                          |
| Context window   | 1,050,000 tokens                                |
| Maximum input    | 922,000 tokens                                  |
| Maximum output   | 128,000 tokens, including reasoning             |
| Reasoning effort | `none`, `low`, `medium`, `high`, `xhigh`, `max` |
| Default effort   | medium                                          |

These are the native model limits. Requests also depend on the available channel and account limits. Audio and video input are not supported.

## Connect and send a request [#connect-and-send-a-request]

Create a key in [API key settings](/settings/apikeys). Keep it on your server as `WAN_API_KEY`. One key and the same prepaid balance work across models and groups. Use the exact model ID, including the decimal point in 6.1 IDs.

```bash
curl https://api.wanapi.app/v1/responses \
  -H "Authorization: Bearer $WAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-terra",
    "input": "Explain the purpose of a database index in three sentences.",
    "reasoning": {"effort": "low"},
    "max_output_tokens": 1024
  }'
```

```python
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["WAN_API_KEY"],
    base_url="https://api.wanapi.app/v1",
)
response = client.responses.create(
    model="gpt-6.1-terra",
    input="Explain the purpose of a database index in three sentences.",
    reasoning={"effort": "low"},
    max_output_tokens=1024,
)
print(response.output_text)
```

## Responses parameters [#responses-parameters]

| Field                                                                | Required | Contract                                                                                                    |
| -------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| `model`                                                              | Yes      | `gpt-6.1-terra`.                                                                                            |
| `input`                                                              | Yes      | Prompt string or an array of input items.                                                                   |
| `instructions`                                                       | No       | System or developer instructions.                                                                           |
| `max_output_tokens`                                                  | No       | Output budget including reasoning; up to 128,000 tokens.                                                    |
| `reasoning.effort`                                                   | No       | none, low, medium, high, xhigh, max.                                                                        |
| `reasoning.summary`                                                  | No       | `auto`, `concise` or `detailed`.                                                                            |
| `text.verbosity`                                                     | No       | `low`, `medium` or `high`.                                                                                  |
| `text.format`                                                        | No       | Text or structured output, such as a supported JSON Schema.                                                 |
| `stream`                                                             | No       | `true` for server-sent events; otherwise a complete response.                                               |
| `tools`, `tool_choice`                                               | No       | Tool declarations and selection. Your application executes client functions.                                |
| `parallel_tool_calls`, `max_tool_calls`                              | No       | Tool concurrency and call limits where supported.                                                           |
| `include`                                                            | No       | Additional response fields, for example `reasoning.encrypted_content`.                                      |
| `metadata`, `store`                                                  | No       | Metadata and response storage preference.                                                                   |
| `previous_response_id`                                               | No       | Earlier response ID, only while it remains available to the serving upstream.                               |
| `truncation`                                                         | No       | Input truncation policy.                                                                                    |
| `prompt_cache_key`, `prompt_cache_retention`, `prompt_cache_options` | No       | Cache routing and retention where supported by the channel.                                                 |
| `reasoning.mode`, `reasoning.context`                                | No       | Forwarded to the upstream; model-specific restrictions apply. Omit them unless your workflow requires them. |
| `context_management`, `conversation`, `prompt`                       | No       | Native context or stored-prompt settings where supported by the upstream.                                   |

## Reasoning and tools [#reasoning-and-tools]

Terra supports `none` for non-reasoning requests. Tool calling requires the Responses API, including when reasoning is disabled.

Omit `temperature`, `top_p` and `top_logprobs` when reasoning is enabled. For Chat Completions, also omit `logprobs`; for Responses, do not request `message.output_text.logprobs` in `include`.

The output budget covers both reasoning and visible text. An output limit may be reached before a complete answer is produced. Higher effort can use more output tokens and take longer.

For structured output, use `text.format` with `type: "json_schema"`, a name and a schema supported by the model. A schema constrains the shape, not the factual accuracy. Return client function results with the original call ID when continuing a tool conversation.

## Current API coverage [#current-api-coverage]

The gateway accepts `POST /v1/responses` and `POST /v1/chat/completions`. Model availability is determined by the configured channels; check authenticated `GET /v1/models` before integrating. Missing prices below do not establish that a model is ready for calls.

The compatibility layer forwards recognized fields rather than arbitrary JSON. The current Responses DTO does not include native `access_programs`, `image` or `background` fields. Do not assume an ignored field took effect. `service_tier` and `safety_identifier` can also be filtered by channel settings.

This integration does not provide a Files API, Batch API or a background-response polling workflow. Use synchronous responses or SSE. Built-in tools depend on upstream availability and can have separate charges; declaring one does not establish that the full tool session is available here.

## Image input [#image-input]

Use a publicly accessible HTTP(S) image URL that you host. Put the image and the question in a user input item:

```json
{"role":"user","content":[
  {"type":"input_image","image_url":"https://example.com/chart.png"},
  {"type":"input_text","text":"What does this chart show?"}
]}
```

Replace the example URL with your own image. No upload or media storage service is provided by this integration.

## Chat Completions [#chat-completions]

```bash
curl https://api.wanapi.app/v1/chat/completions \
  -H "Authorization: Bearer $WAN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-6.1-terra",
    "messages": [{"role":"user","content":"Explain what a database index does."}],
    "reasoning_effort": "low",
    "max_completion_tokens": 1024
  }'
```

Read `choices[0].message.content`. Chat Completions uses `messages`, `reasoning_effort` and `max_completion_tokens`; Responses uses `input`, `reasoning.effort` and `max_output_tokens`. For image messages in Chat Completions, use `type: "image_url"` and `image_url: {"url":"https://..."}`.

## Pricing [#pricing]

USD per 1 million tokens

Current rates include each group’s multiplier. Prices are cached for up to 2 minutes.

One API key works across all models and groups. Default marks the first eligible group in the automatic routing order; the request is billed at the rates of the group actually selected.

### GPT Terra 6.1

`gpt-6.1-terra`

| Billable tokens | gpt · Default · ≤ 272,000 input tokens | gpt · Default · > 272,000 input tokens |
| --- | ---: | ---: |
| Input (uncached) | $0.1 | $0.2 |
| Output | $0.5 | $0.75 |
| Cache read | $0.005 | $0.01 |
| Cache write | $0.125 | $0.25 |

The threshold uses: Uncached input tokens. The selected band applies to the whole request, not only the tokens above the threshold.

— means no verified quote is available; it does not mean free.

Cache rates apply only when the response reports the corresponding cache usage. Do not count cached tokens again as uncached input.

Multiply each billable token count by its matching rate and divide by 1,000,000. Reasoning is included in output tokens and is not charged again. Cached input must not also be counted as uncached input. Use only cache usage reported by the response; the table's cache-write unit does not imply support for every retention mode.

For length-based prices, the applicable band covers the whole request. Read the table's threshold and input basis rather than assuming a fixed rate. Requests without a group header use `gpt`. To choose a group for Responses or Chat Completions, send `X-Model-Group: gpt` or `X-Model-Group: gpt-0.7`. `gpt-0.7` is available for Luna, Sol and Astra only; Terra supports `gpt` only. Explicit selections never fall back to another group. Keep the model ID unchanged; group suffixes are not supported.

## Responses and streaming [#responses-and-streaming]

A completed Responses result contains `id`, `model`, `status`, `output` and `usage`. `output` can contain reasoning, tool calls and messages; do not assume its first item is text. The OpenAI SDK's `output_text` helper collects text output.

Set `stream: true` and use `curl -N` for SSE. Handle `response.created`, `response.output_text.delta`, `response.completed`, incomplete responses and errors. The terminal response carries usage. Chat Completions streams `choices[].delta`; request `stream_options: {"include_usage":true}` for its final usage chunk.

## Usage logs and errors [#usage-logs-and-errors]

[LLM logs](/usage) show completed calls from the last 7 days with the model, input tokens, output tokens and cost. Filter by `gpt-6.1-terra`. Images and videos use [Task logs](/tasks).

On failure, inspect the HTTP status and `error` object. Check your key, [balance](/docs/balance), exact model ID and parameter combination. If a request or stream is interrupted, check the logs before retrying: another request can incur another charge.

## Model references [#model-references]

* [GPT Terra 6.1 official specification](https://developers.openai.com/api/docs/models/gpt-6.1-terra)
* [Responses reference](https://developers.openai.com/api/reference/resources/responses/methods/create)
* [GPT models and reasoning](https://developers.openai.com/api/docs/guides/latest-model)
