# GPT-6.1 Terra

> GPT-6.1 Terra API on PoYo for visual reasoning, computer use, and natural writing. $0.80 input and $4 output per million tokens, 20% below official standard rates.

## Overview

- Endpoint: `https://api.poyo.ai/v1/chat/completions`
- Page: https://poyo.ai/models/gpt-6-1-terra
- Model page ID: `gpt-6-1-terra`
- API model ID: `gpt-6.1-terra`
- Category: Chat
- Auth: `Authorization: Bearer $POYO_API_KEY`
- Create a key at https://poyo.ai/dashboard/api-key

This model uses a synchronous chat API. POST the JSON body below. There is no `task_id` and no status polling.

## Pricing

- Input: 160 credits ($0.800) per 1M tokens
- Output: 800 credits ($4.00) per 1M tokens

For more details, see https://poyo.ai/models/gpt-6-1-terra.

## API Information

POST the JSON body below. Fields are top-level unless noted.

### Request body

- `model` (`string`, required):
  Model name. Example: `gpt-5.2`, `claude-sonnet-4-5-20250929`, `gemini-3-flash-preview`.
  - Examples: "gpt-5.2"
- `messages` (`list`, required):
  List of conversation messages. Each message contains a `role` and `content`. Use `system` to define model behavior, `user` for user input, and `assistant` for previous model responses in multi-turn conversations. Example: [{"role": "user", "content": "Explain vector databases in one sentence."}].
  - Array of ChatMessage
- `temperature` (`float`, optional):
  Controls output randomness, range 0-2. Lower values such as 0.2 make output more deterministic. Higher values such as 1.8 make output more random. Default: 1.0.
  - Range: `0` to `2`
  - Examples: `1`
- `max_tokens` (`integer`, optional):
  Maximum number of tokens to generate. Different models have different maximum limits.
  - Range: `1` to `+∞`
  - Examples: `256`
- `stream` (`boolean`, optional):
  Whether to use streaming output. `true` returns a streaming response in SSE format. `false` returns the complete response at once. Default: false.
  - Examples: `false`
- `top_p` (`float`, optional):
  Nucleus sampling parameter, range 0-1. Controls diversity of generated text. We recommend using either `top_p` or `temperature`, not both. Default: 1.0.
  - Range: `0` to `1`
  - Examples: `1`
- `frequency_penalty` (`float`, optional):
  Frequency penalty, range -2.0 to 2.0. Positive values reduce the likelihood of repeating the same words. Default: 0.
  - Range: `-2` to `2`
  - Examples: `0`
- `presence_penalty` (`float`, optional):
  Presence penalty, range -2.0 to 2.0. Positive values increase the likelihood of talking about new topics. Default: 0.
  - Range: `-2` to `2`
  - Examples: `0`
- `stop` (`string | array`, optional):
  Stop sequences. Up to 4 sequences where generation will stop when encountered.
  - One of: string | array
- `n` (`integer`, optional):
  Number of completions to generate. Default: 1. Must be a plain number such as `1`; do not use quotes.
  - Range: `1` to `+∞`
  - Examples: `1`

Required Parameters Example:

```json
{
  "model": "gpt-6.1-terra",
  "messages": [
    {
      "role": "system",
      "content": "You are a structured output assistant. Reply with JSON only."
    },
    {
      "role": "user",
      "content": "Generate a paginated list response example with fields items, page, page_size, total and sample values."
    }
  ]
}
```

Full Example:

```json
{
  "model": "gpt-6.1-terra",
  "messages": [
    {
      "role": "system",
      "content": "You are a structured output assistant. Reply with JSON only."
    },
    {
      "role": "user",
      "content": "Generate a paginated list response example with fields items, page, page_size, total and sample values."
    }
  ]
}
```

### Output Schema

The response is returned from the same request. There is no separate status endpoint.

Response fields:

- `code` (`integer`, optional):
  - Examples: `200`
- `data` (`object`, optional):

Example Response:

```json
{
  "code": 200,
  "data": {
    "id": "chatcmpl-9876543210",
    "object": "chat.completion",
    "created": 1677652288,
    "model": "gpt-6.1-terra",
    "choices": [
      {
        "index": 0,
        "message": {
          "role": "assistant",
          "content": "The history of artificial intelligence (AI) dates back to the 1950s..."
        },
        "finish_reason": "stop"
      }
    ],
    "usage": {
      "prompt_tokens": 28,
      "completion_tokens": 320,
      "total_tokens": 348
    }
  }
}
```

## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://api.poyo.ai/v1/chat/completions \
  --header "Authorization: Bearer $POYO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"model":"gpt-6.1-terra","messages":[{"role":"system","content":"You are a structured output assistant. Reply with JSON only."},{"role":"user","content":"Generate a paginated list response example with fields items, page, page_size, total and sample values."}]}'
```

### Python

```python
import json
import os
import requests

headers = {
    "Authorization": f"Bearer {os.environ['POYO_API_KEY']}",
    "Content-Type": "application/json",
}
payload = json.loads("{\n  \"model\": \"gpt-6.1-terra\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are a structured output assistant. Reply with JSON only.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Generate a paginated list response example with fields items, page, page_size, total and sample values.\"\n    }\n  ]\n}")

response = requests.post("https://api.poyo.ai/v1/chat/completions", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const headers = {
  Authorization: `Bearer ${process.env.POYO_API_KEY}`,
  "Content-Type": "application/json",
};

const response = await fetch("https://api.poyo.ai/v1/chat/completions", {
  method: "POST",
  headers,
  body: JSON.stringify({
  "model": "gpt-6.1-terra",
  "messages": [
    {
      "role": "system",
      "content": "You are a structured output assistant. Reply with JSON only."
    },
    {
      "role": "user",
      "content": "Generate a paginated list response example with fields items, page, page_size, total and sample values."
    }
  ]
}),
});

console.log(await response.json());
```

## Additional Resources

### Documentation

- [Model Playground](https://poyo.ai/models/gpt-6-1-terra)
- [API Documentation](https://docs.poyo.ai/api-manual/chat-series/chat-completions)
- [API Documentation (Markdown)](https://docs.poyo.ai/api-manual/chat-series/chat-completions.md)

### Other agent-readable surfaces

- [Platform overview](https://poyo.ai/llms.txt)
- [Documentation index](https://docs.poyo.ai/llms.txt)
- [Full documentation text](https://docs.poyo.ai/llms-full.txt)
- Any other model: `https://poyo.ai/models/<model-id>/llms.txt`
