Direct antwoord

Deze pagina legt uit hoe teams de OpenAI-compatibele gateway van NextModel gebruiken. Every live gateway endpoint, grouped by protocol, with auth conventions and rate-limit headers. Ze voegt de praktische stappen, configuratienotities en veelgestelde vragen toe.

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/modelsList 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/creditsCurrent prepaid credit balance
GET /v1/activityPaginated 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/completionsChat completions; supports stream, tools/function calling, idempotency_key
POST /v1/responsesOpenAI Responses API ingress
POST /v1/embeddingsText embeddings (openai/text-embedding-3-small, openai/text-embedding-3-large)
POST /v1/images/generationsImage generation (openai/gpt-image-1 and other image models)
POST /v1/audio/speechText to speech (openai/tts-1, openai/tts-1-hd)
POST /v1/videosSubmit 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/messagesAnthropic Messages API; supports streaming and tool use
POST /v1/messages/count_tokensCount tokens for a Messages request
POST /v1/messages/batchesCreate a Message Batch
GET /v1/messages/batches/{batch_id}Retrieve a batch and its processing status
POST /v1/messages/batches/{batch_id}/cancelCancel a batch that is still processing
GET /v1/messages/batches/{batch_id}/resultsDownload 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/runRun one prompt through a multi-model council; body: template (code-review-council or contract-review-council), message, stream
POST https://nextmodel.app/v1/receipts/verifyVerify 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.