OpenAI-compatible completions and SSE.
Use the protocol your application expects.
Use your RouteMesh API key as a Bearer token and pass an explicit model ID. The gateway returns a Generation ID in every response.
Chat Completions quickstart
Use your RouteMesh API key as a Bearer token and pass an explicit model ID. The gateway returns a Generation ID in every response.
curl https://api.routemesh.ai/v1/chat/completions \
-H "Authorization: Bearer $ROUTEMESH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-6-astra",
"stream": true,
"messages": [{"role": "user", "content": "Hello RouteMesh"}],
"provider": {"zdr": true, "allow_fallbacks": true}
}'Gateway endpoints
OpenAI Responses input items and event streams; built-in image_generation tools are currently rejected.
OpenAI image generation and partial-image events.
JSON image references or multipart image editing with an OpenAI-compatible model.
Multipart image variations for supported models.
Anthropic-compatible Messages API.
OpenAI-compatible vector embeddings.
Public model catalog.
Trace provider, usage, latency, and cost.
Use provider.order, only, ignore, allow_fallbacks, max_price, data_collection, and zdr to constrain the endpoint set. Fallback never changes the selected model.
Errors return a structured object with code, message, type, and request_id. Invalid keys return 401, insufficient credits return 402, rate limits return 429, and unavailable endpoints return 503.