Bezpośrednia odpowiedź
Ta strona wyjaśnia, jak zespoły korzystają z bramy NextModel zgodnej z OpenAI. Every live gateway endpoint, grouped by protocol, with auth conventions and rate-limit headers. Dodaje praktyczne kroki, uwagi konfiguracyjne i najczęstsze pytania.
Conventions
All endpoints live under the base URL https://api.nextmodel.app and authenticate with Authorization: Bearer $NEXTMODEL_API_KEY unless marked otherwise — GET /v1/models is the only unauthenticated endpoint. Model ids are sent verbatim with their provider prefix (see Model IDs). Errors share one envelope with a machine-readable code and a billing_status field, documented on the Errors page. Streaming endpoints use server-sent events when stream is true, and POST bodies accept an idempotency_key field for safe retries. Rate limits are 6,000 requests per minute per IP and per account; responses carry x-ratelimit-limit-requests, x-ratelimit-remaining-requests, and x-ratelimit-reset, and rejected requests carry Retry-After.
Account and catalog
Catalog reads and account state need no generation request — use them to wire model pickers and budget guards.
| GET /v1/models | List all live models with context length and capability flags; no authentication required |
| GET /v1/models/{id} | Retrieve one model; ids are matched against the raw path, so slashes need no URL encoding |
| GET /v1/credits | Current prepaid credit balance |
| GET /v1/activity | Paginated usage records plus summary; page with since, limit, offset |
OpenAI-compatible generation
These follow the OpenAI request and response shapes, so OpenAI SDKs work by changing the base URL and key.
| POST /v1/chat/completions | Chat completions; supports stream, tools/function calling, idempotency_key |
| POST /v1/responses | OpenAI Responses API ingress |
| POST /v1/embeddings | Text embeddings (openai/text-embedding-3-small, openai/text-embedding-3-large) |
| POST /v1/images/generations | Image generation (openai/gpt-image-1 and other image models) |
| POST /v1/audio/speech | Text to speech (openai/tts-1, openai/tts-1-hd) |
| POST /v1/videos | Submit a video generation job (alias: /v1/video/generations) |
| GET /v1/videos/{job_id} | Poll a video job until it completes (alias: /v1/video/jobs/{job_id}) |
Anthropic-native
These follow the Anthropic request and response shapes, so Anthropic SDKs and Claude Code work by changing the base URL and key. Errors on these routes return the Anthropic envelope; the billing headers are the same.
| POST /v1/messages | Anthropic Messages API; supports streaming and tool use |
| POST /v1/messages/count_tokens | Count tokens for a Messages request |
| POST /v1/messages/batches | Create a Message Batch |
| GET /v1/messages/batches/{batch_id} | Retrieve a batch and its processing status |
| POST /v1/messages/batches/{batch_id}/cancel | Cancel a batch that is still processing |
| GET /v1/messages/batches/{batch_id}/results | Download per-request results for a batch |
Platform endpoints
Beyond the two OpenAI/Anthropic protocol families, the gateway exposes a multi-model council runner and the receipt verification API. Receipt verification is served on the website origin and authenticates with your dashboard session, not an API key — see Verifying responses.
| POST /v1/council/run | Run one prompt through a multi-model council; body: template (code-review-council or contract-review-council), message, stream |
| POST https://nextmodel.app/v1/receipts/verify | Verify a provenance receipt against the anchored Merkle batch |
Deliberately not live
Some protocol-shaped paths exist for forward compatibility but are not served: Gemini, Mistral, Cohere, DashScope, and Bedrock native ingress return 501 protocol_runtime_not_routed until enabled, and /v1/images/edits is not offered. Audio transcription returns 404 transcription_ingress_disabled while the ingress flag is off. Do not build against these; watch the changelog for activation.