Skip to main content
Vendor: OpenAI Model ID: gpt-5-2 Capability: 128K context · tool use · vision · streaming · structured output Pricing: per-token, standard tier (live rate) GPT-5.2 was the first refinement step on the original GPT-5 — same shape, more reliable structured output. It’s still a competent production model for any team that’s already benchmark-validated against this version. For new work, prefer GPT-5.4 or GPT-5.5.

Request

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-5-2",
    "messages": [{"role": "user", "content": "Summarize this earnings transcript section."}]
  }'

Body parameters

FieldTypeRequiredDefaultNotes
modelstringyesgpt-5-2
messagesarrayyes
max_tokensintegernomodel maxMax: 16384.
temperaturenumberno1.0
toolsarraynoFunction calling supported (parallel).
response_formatobjectnoJSON mode + structured output.
streambooleannofalseSSE streaming.

Response

{
  "id": "chatcmpl-…",
  "object": "chat.completion",
  "model": "gpt-5-2",
  "choices": [{"index": 0, "message": {"role": "assistant", "content": "..."}, "finish_reason": "stop"}],
  "usage": {"prompt_tokens": 1024, "completion_tokens": 218, "total_tokens": 1242}
}

Code examples

curl https://llm.bytespike.ai/v1/chat/completions \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "gpt-5-2", "messages": [{"role": "user", "content": "..."}]}'

Streaming + caching

"stream": true for SSE. Automatic prompt caching on stable prefixes, discounted rate per pricing table.

Errors

CodeTriggerBilled?
400 / 401 / 402 / 422 / 429StandardNo
5xxUpstream issueNo (auto-retry)

When to use

  • Existing code validated against this exact version.
  • For new work, prefer GPT-5.4 or GPT-5.5.
  • For lower cost, see GPT-5-mini.

Limits

LimitValue
Context window128K tokens
Max output16384 tokens
Supports tool useYes (parallel)
Supports visionYes
Supports streamingYes
Supports prompt cachingAutomatic