The complete reference for the LYRouter gateway API. Every endpoint is served at https://api.lyrouter.com and authenticates with the same API key: the chat, embeddings and image endpoints are compatible with the OpenAI format, /v1/messages is compatible with the Anthropic format, and video generation runs as asynchronous tasks.
Overview
The API documentation has two groups:
AI model APIs: grouped by capability, one page per endpoint. Each page gives the method and path, authentication, headers, request body, request examples, responses and common errors.
General: conventions shared by every endpoint, including base URLs and authentication, model identifiers, streaming, tool calls, asynchronous tasks, the request and response headers the gateway adds, error codes and protocol compatibility, and how to give these docs to AI tools.
The path prefix can also use another version number or be left out: for example, /v4/chat/completions and /chat/completions are the same as /v1/chat/completions, which helps tools that require a fixed prefix.
OpenAI endpoints not in the table, such as /v1/completions, /v1/files, /v1/batches and /v1/moderations, are not exposed by the gateway, and requests to them return 404.
Falls back to the default model after everything fails
/v1/chat/completions
Supported
Supported
Supported
Synchronous
Yes
/v1/responses
Supported
Supported
Supported
Synchronous
Yes
/v1/messages
Supported
Supported
Supported
Synchronous
Yes
/v1/embeddings, /v1/rerank
Supported; the model list must contain matching embedding or rerank models
Do not use: the gateway currently does not reject it, but you get no usable result; see Create embeddings
Not supported
Synchronous
Yes, but the default model is usually a chat model, so the result is usually an error
/v1/images/*
Not supported (403)
Not supported (403)
Depends on the model
Synchronous
No
/v1/videos and its sub-endpoints
Not supported (403)
Not supported (403)
Not supported
Asynchronous task
No
Virtual models and Auto: on endpoints that do not support them, the gateway returns 403 Model is not available in the model plaza; use a specific model ID instead. For details, see Virtual models and Auto routing.
Streaming: the three chat endpoints turn it on with stream: true; for formats and end markers, see Streaming.
Asynchronous tasks: the video endpoints return a task ID as soon as you submit, and you then query the status and download the artifact; for the full flow, see Asynchronous tasks. Image endpoints return synchronously, but a single call can take several minutes, so set client timeouts in minutes.
Fallback on failure: when a model has several channels, every endpoint tries the channels in turn; moving on to another model happens only on the chat, embeddings and rerank endpoints; see Retries and fallback.