Skip to main content

Supported endpoints

The gateway serves OpenAI-compatible endpoints for every provider, plus native endpoints for Anthropic, Google and AWS clients, and management endpoints for keys, users and spend. OpenAI-style routes work with or without the /v1 prefix. Which providers support each endpoint is recorded in the gateway's endpoint support matrix, and each guide below lists them.

A real-world scenario​

A product team builds a feature that needs chat, embeddings and image generation from three different providers. Instead of three SDKs and three sets of keys, they call the gateway's /v1/chat/completions, /v1/embeddings and /v1/images/generations with one virtual key, and the gateway translates each call to the provider that serves the model. When the mobile team later needs the Anthropic Messages format for a client library, the same gateway serves /v1/messages to them with the same key.

Inference endpoints​

EndpointRouteGuide
Chat completions/v1/chat/completionsChat completions
Responses API/v1/responsesResponses API
Anthropic Messages/v1/messagesAnthropic Messages
Count tokens/v1/messages/count_tokensCount tokens
Google generateContent/v1beta/models/{model}:generateContentgenerateContent
Google Interactions/v1beta/interactionsInteractions
Bedrock Converse and Invoke/bedrock/...Converse, Invoke
Text completions/v1/completionsText completion
Embeddings/v1/embeddingsEmbeddings
Image generation, edits, variations/v1/images/...Images, edits, variations
Transcription and speech/v1/audio/transcriptions, /v1/audio/speechTranscription, speech
Realtime/v1/realtimeRealtime
Video/v1/videosVideos
Rerank/v1/rerankRerank
Moderation/v1/moderationsModeration
OCR/v1/ocrOCR
Search/v1/searchSearch
Decisions/v1/decisionsDecisions

Data and job endpoints​

EndpointRouteGuide
Files and batches/v1/files, /v1/batchesBatches, managed files
Fine-tuning/v1/fine_tuning/jobsManaged fine-tuning
Assistants/v1/assistants, /v1/threadsAssistants
Containers and container files/v1/containersContainers, container files
Vector stores/v1/vector_storesCreate, search, files
RAG/v1/rag/ingest, /v1/rag/queryIngest, query
Skills/v1/skillsSkills

Agents and tools​

EndpointGuide
Model Context Protocol serversMCP
Agent-to-agent protocolA2A
Apply a guardrail directlyApply guardrail
Provider native routesPass-through endpoints

Management endpoints​

Keys, users, teams, organizations, budgets, spend, models, guardrails, health and enterprise features all have REST endpoints. They are listed by tag in the API reference, and the most used ones are explained in virtual keys, users, cost tracking and health.

Try an endpoint​

Every endpoint takes the same Authorization: Bearer header with a virtual key or the master key and a model that matches a model_name on the gateway.

  1. List the models your key may use, which also tells you which endpoints they serve through their mode:

    curl http://localhost:4000/model_group/info -H "Authorization: Bearer $SPANWAY_API_KEY"

    Expected result: one entry per model group with mode set to chat, embedding, image_generation and so on, plus its token limits and prices.

  2. Call an inference endpoint, for example embeddings:

    curl http://localhost:4000/v1/embeddings \
    -H "Authorization: Bearer $SPANWAY_API_KEY" -H "Content-Type: application/json" \
    -d '{"model": "text-embedding-3-small", "input": "The gateway speaks every provider."}'

    Expected result: an OpenAI-format embeddings response with one vector and a usage block.

  3. In the Admin UI, Models + Endpoints shows the mode of each model, the Playground lets you try chat, Responses and Anthropic Messages against any model, and API Reference opens the generated reference for every route by tag.

Errors​

StatusMeaningFix
404 Not Found on an endpointThe route is not served, for example a pass-through route that is not configured or an enterprise route without a license.Check the guide for the endpoint, and GET /routes for the routes this gateway serves.
400 Invalid model name passed in model=...The model is not a registered model_name.Use a name from /model_group/info.
400 ... does not support parameters: [...]The provider behind the model does not accept a parameter you sent.Remove it, or set drop_params: true in spanway_settings.
401 Authentication Error, No api key passed in.The request carried no key.Send the bearer token.
A provider error after calling an endpoint with a model of another kindThe gateway does not check that a model suits the endpoint, so embeddings on a chat model reach the provider, which refuses them.Call each endpoint with a model of the matching Mode.

Logs​

Each call is one row on the Logs page (/ui/logs) with its key, team, model group, deployment, tokens, cost, latency and status, failed calls included. Prompt and response text is kept only when the gateway is set to store it, see what the gateway stores. Operator log lines for routing, retries and fallbacks are in the log reference.