Skip to content

Yunshu Router docs

Call any model with the OpenAI or Anthropic SDK you already use. One key, a prepaid balance, and a price per token. Start here.

Get an API key

Yunshu Router is one API for many models. You send requests in the OpenAI or the Anthropic format, with one API key, and each request is charged per token to your prepaid balance.

If you already use the OpenAI or Anthropic SDK, you change two things: the base URL and the key.

  • New here? Read the Quickstart. Your first request takes about five minutes.
  • Setting up a coding tool? Check the Base URL cheat sheet first. A wrong /v1 is the most common setup error.
  • Something failed? The Errors page lists every code, what it means and what to do.

Base URLs

Format Base URL
OpenAI (Chat Completions, Responses) https://api.yunshurouter.com/v1
Anthropic (Messages) https://api.yunshurouter.com (no /v1; the SDK adds it)

Endpoints

Method Path What it does
POST /v1/chat/completions OpenAI Chat Completions
POST /v1/messages Anthropic Messages
POST /v1/messages/count_tokens Count a prompt’s input tokens (free)
POST /v1/responses OpenAI Responses (stateless)
GET /v1/models Models your key can use, with prices
GET /v1/generation?id= Cost and token counts for one request
POST GET /v1/batches Submit and list off-peak batches
GET /v1/batches/{id} and /v1/batches/{id}/results One batch, and its results
POST /v1/batches/{id}/cancel Cancel what has not run yet
DELETE /v1/batches/{id} Cancel and delete stored prompts and results

We do not serve embeddings, images, audio or other endpoints.