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
| Endpoint | Route | Guide |
|---|---|---|
| Chat completions | /v1/chat/completions | Chat completions |
| Responses API | /v1/responses | Responses API |
| Anthropic Messages | /v1/messages | Anthropic Messages |
| Count tokens | /v1/messages/count_tokens | Count tokens |
| Google generateContent | /v1beta/models/{model}:generateContent | generateContent |
| Google Interactions | /v1beta/interactions | Interactions |
| Bedrock Converse and Invoke | /bedrock/... | Converse, Invoke |
| Text completions | /v1/completions | Text completion |
| Embeddings | /v1/embeddings | Embeddings |
| Image generation, edits, variations | /v1/images/... | Images, edits, variations |
| Transcription and speech | /v1/audio/transcriptions, /v1/audio/speech | Transcription, speech |
| Realtime | /v1/realtime | Realtime |
| Video | /v1/videos | Videos |
| Rerank | /v1/rerank | Rerank |
| Moderation | /v1/moderations | Moderation |
| OCR | /v1/ocr | OCR |
| Search | /v1/search | Search |
| Decisions | /v1/decisions | Decisions |
Data and job endpoints
| Endpoint | Route | Guide |
|---|---|---|
| Files and batches | /v1/files, /v1/batches | Batches, managed files |
| Fine-tuning | /v1/fine_tuning/jobs | Managed fine-tuning |
| Assistants | /v1/assistants, /v1/threads | Assistants |
| Containers and container files | /v1/containers | Containers, container files |
| Vector stores | /v1/vector_stores | Create, search, files |
| RAG | /v1/rag/ingest, /v1/rag/query | Ingest, query |
| Skills | /v1/skills | Skills |
Agents and tools
| Endpoint | Guide |
|---|---|
| Model Context Protocol servers | MCP |
| Agent-to-agent protocol | A2A |
| Apply a guardrail directly | Apply guardrail |
| Provider native routes | Pass-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.
-
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
modeset tochat,embedding,image_generationand so on, plus its token limits and prices. -
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
usageblock. -
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
| Status | Meaning | Fix |
|---|---|---|
404 Not Found on an endpoint | The 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 kind | The 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.
Related
- API reference for every route by tag.
- Chat completions for the most used endpoint.
- Pass-through endpoints for provider native routes.
- Gateway overview for how a request flows.