6 image models · capabilities and pricing in one placeSee pricing →

OGA DEVELOPER CENTER

API v1 · Last verified 2026-08-15

API quick start and common endpoints

Follow the steps from choosing a model to receiving an image. Find authentication, parameters, request examples and common errors.

Browse common endpoints

Your first call takes three steps

Images use OGA-native endpoints; text Claude Opus 5.5 also exposes a controlled OpenAI-compatible /v1/chat/completions interface for common open-source frameworks. Choose the endpoint for the modality.

async is the default. sync still creates a durable task first and waits up to 60 seconds; a timeout returns 202 with the same task_id and never resubmits automatically.

Authentication and key safety

Authenticated endpoints use Authorization: Bearer <YOUR_OGA_API_KEY>. This is an OGA platform key, not an upstream provider credential. Use it only from a controlled backend or this same-origin explorer.

Never place it in a URL

An API key is not a query parameter and must not enter browser history, analytics, or access logs.

The explorer does not persist it

The password field keeps the key only in this page's memory; copied examples always use a placeholder.

Use text models in OpenAI-compatible apps

Choose OpenAI-compatible in an app that supports custom providers, then enter these three settings. Never use an upstream URL or upstream key.

Base URL
https://opengptapi.com/v1
API Key
Your OGA user full-access Key
Model
claude-opus-5-5

Without a group, selection follows the API Key's allowed groups and routing strategy.

How do I choose a pricing group?

The same Claude model supports two group modes: omit the group to follow the API Key's allow/exclude rules and strategy, or use group/model, such as 002/claude-opus-5-5. An unauthorized explicit group returns 403 before billing.

  • 001/claude-opus-5-5 · claude-opus-5-5-group-001 — Group 001
  • 002/claude-opus-5-5 · claude-opus-5-5-group-002 — Group 002
  • 003/claude-opus-5-5 · claude-opus-5-5-group-003 — Group 003
  • 004/claude-opus-5-5 · claude-opus-5-5-group-004 — Group 004
Python OpenAI SDK example

This example creates a Token-billed request when run. Reading or copying sends nothing. Check the group rate and Key budget first.

from openai import OpenAI

client = OpenAI(
    base_url="https://opengptapi.com/v1",
    api_key="YOUR_OGA_API_KEY",
)
result = client.chat.completions.create(
    model="002/claude-opus-5-5",
    messages=[{"role": "user", "content": "Hello"}],
    max_completion_tokens=512,
)
print(result.choices[0].message.content)
Streaming, tools and safe retries

Supports stream=true, stream_options.include_usage, system/developer, multi-turn text and function tools/tool_calls. Your application executes tools and returns tool messages; OGA does not execute functions.

Use max_tokens or max_completion_tokens; the default is 4096. temperature and top_p are 0–1 and n must be 1. Image/audio inputs, strict=true tools, JSON Schema guarantees and the Responses API are not included.

Give each business call an Idempotency-Key and keep it with the exact request on retry. A first call without one receives an independent server identifier; prompts are not deduplicated. Header-declared Stainless retries without a key are rejected; other clients should also disable automatic retries or use stable keys. A committed replay keeps its original group even if the Key policy or prices later change.

For timeout, stream loss or unknown usage, recover the original task using X-OGA-Task-Id / Location. Do not blindly resubmit with another key/group. A client disconnect neither cancels accepted work nor makes it free.

Text models and Token pricing

Text models provide both the OGA-native text-task API and an OpenAI-compatible Chat Completions interface. Input, output and cache tokens are priced separately per million tokens, with the group rate locked at task creation.

TEXT MODEL · TOKEN PRICING

Text models · billed per million tokens

Choose a model and pricing group. Input, output and cache are billed separately, with rates locked at task creation.

Selectable
PRICING GROUP

Group 001

claude-opus-5-5

Available
Input / 1M
$0.661827
Output / 1M
$3.309132
Cache read / 1M
$0.066183
Cache write / 1M
$0.827283
PRICING GROUP

Group 002

claude-opus-5-5

Available
Input / 1M
$5.000000
Output / 1M
$25.000000
Cache read / 1M
$5.000000
Cache write / 1M
$5.000000
PRICING GROUP

Group 003

claude-opus-5-5

Available
Input / 1M
$8.500000
Output / 1M
$42.500000
Cache read / 1M
$8.500000
Cache write / 1M
$8.500000
PRICING GROUP

Group 004

claude-opus-5-5

Available
Input / 1M
$36.500000
Output / 1M
$182.500000
Cache read / 1M
$36.500000
Cache write / 1M
$36.500000
Compare input and output rates in a chart

Compare group rates

Compare input and output on the same unit; cache rates are listed above. Tasks settle with locked rates and verified usage.

USD / 1M Token
GroupInputOutput
claude-opus-5-5 · Group 0010.6618273.309132
claude-opus-5-5 · Group 0025.00000025.000000
claude-opus-5-5 · Group 0038.50000042.500000
claude-opus-5-5 · Group 00436.500000182.500000

Price snapshot: 2026-11-11T18:06:23.801292Z

The price is locked when a task is created. Unknown acceptance or missing final usage stays pending reconciliation; the platform does not silently switch groups or treat it as free.

Read the model before choosing parameters

1K, 2K, 4K, ratios, observed pixels, reference-image counts, output formats, quality tiers, and prices must come from the current model detail. Route rows may differ, and omitted combinations must not be inferred.

Open models and pricing

Idempotency and unknown acceptance

OGA-native writes require a business-unique Idempotency-Key. A first OpenAI-compatible request may omit it and receive an independent identifier; stable client keys are recommended for retries. The same key and exact request recover the original task; changed semantics return 409. Recover an unknown task instead of blindly resubmitting.

Pricing, billing, and refunds

Only the current public price_matrix in model details is authoritative. The final route and price snapshot are locked at task creation, settlement follows the same billing contract, and refunds follow the route row's structured public policy.

Before a billable POST, the explorer explicitly retrieves the current same-origin model detail and enables confirmation only when every active, routable, capability-matching row has an unambiguous public price.

Errors and result lifetime

HTTP status represents the request outcome. Error envelopes include a stable business code, request_id, retryable, and field-level reasons. Ordinary business rejection is not disguised as 200 or 503. Successful images are retained on the server for 3 hours, and signed URLs expire at the automatic-deletion boundary.

This page is a common-endpoint guide, not a second complete inventory. /openapi.json is the machine-readable source for every REST business capability; the same operation_id is used as the MCP tool name, and Swagger and ReDoc read that same definition.

Interactive reference

Swagger · ReDoc

Code & API explorer

POST · /api/v1/images/tasks

curl -X POST "$OGA_BASE_URL/api/v1/images/tasks" \
  -H "Authorization: Bearer <YOUR_OGA_API_KEY>" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <UNIQUE_IDEMPOTENCY_KEY>" \
  -H "X-Request-Id: <UUID_V4>" \
  -H "Accept-Language: en-US" \
  --data '{
  "model": "gpt-image-2",
  "operation": "generation",
  "prompt": "A quiet blue observatory above the clouds",
  "n": 1,
  "size": "1024x1024",
  "quality": "standard",
  "response_format": "url",
  "response_mode": "async"
}'