Integrate gpt-5.6-terra through openai. Request examples, parameters, authentication and result handling.
/v1/chat/completionsMODELgpt-5.6-terraCode examples & responses
/v1/chat/completionscurl "https://newrouters.com/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
--data '{
"model": "gpt-5.6-terra",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP request works in three concise steps."
}
],
"max_completion_tokens": 1024,
"stream": false
}'const apiBaseUrl = "https://newrouters.com";
const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error("Set API_KEY in your server environment");
const response = await fetch(apiBaseUrl + "/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer " + apiKey
},
body: JSON.stringify({
"model": "gpt-5.6-terra",
"messages": [
{
"role": "user",
"content": "Explain how an HTTP request works in three concise steps."
}
],
"max_completion_tokens": 1024,
"stream": false
})
});
const result = await response.json();
if (!response.ok) throw new Error(JSON.stringify(result));
console.log(result);import json
import os
from urllib.request import Request, urlopen
api_base_url = "https://newrouters.com"
api_key = os.environ["API_KEY"]
body = json.loads("{\"model\":\"gpt-5.6-terra\",\"messages\":[{\"role\":\"user\",\"content\":\"Explain how an HTTP request works in three concise steps.\"}],\"max_completion_tokens\":1024,\"stream\":false}")
request = Request(
api_base_url + "/v1/chat/completions",
data=json.dumps(body).encode("utf-8"),
headers={
"Content-Type": "application/json",
"Authorization": "Bearer " + api_key
},
method="POST",
)
with urlopen(request) as response:
print(json.load(response))The API origin is filled in. Set API_KEY before running. Examples never submit automatically.
200Successful result
{
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "..."
},
"finish_reason": "stop"
}
]
}- Prepare a request01
API key + model IDUse the model’s native protocol and authentication.
SDK / HTTP - Call the native API02
POST /v1/chat/completionsSubmit the request structure documented on this page.
OpenAI - Read the response03
choices[].messageJSON returns a complete result; read SSE increments using native event formats.
JSON / SSE
Use the exact API model ID gpt-5.6-terra. This guide describes the platform contract; check the live catalog before calling the model.
Request example
Section titled “Request example”The platform origin is filled in at build time. Set API_KEY to your server-side key before running.
curl "https://newrouters.com/v1/chat/completions" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $API_KEY" \ --data '{ "model": "gpt-5.6-terra", "messages": [ { "role": "user", "content": "Explain how an HTTP request works in three concise steps." } ], "max_completion_tokens": 1024, "stream": false}'Protocol and response
Section titled “Protocol and response”This model uses the openai protocol. Read its native response and usage fields; do not wrap the request in the media task input envelope.
Supported endpoint templates:
POST /v1/chat/completionsPOST /v1/responses
| Limit | Catalog value |
|---|---|
| Context tokens | 1050000 |
| Maximum output tokens | 128000 |
For streaming, use the native protocol streaming option and parse its events; check supported capabilities in the live catalog.
Official sources and identity
Section titled “Official sources and identity”Checked: 2026-09-27 · Platform model: gpt-5.6-terra · Official reference: gpt-5.6-terra
Pricing and troubleshooting
Section titled “Pricing and troubleshooting”Check current availability, contract and account pricing before integration. Keep request IDs and usage receipts when diagnosing errors. Complete API reference