DocsAPI reference

API reference

Echo Token Station base URLs and authentication, the base URL for each SDK and tool, available endpoints, format conversion, streaming and main parameters.

Echo's API supports the OpenAI format and the Anthropic format. This page covers the endpoints (the URLs you call for each feature), authentication, streaming and the main parameters. For the details of requests and responses, follow each provider's API documentation.

Base URL and authentication

FormatBase URLHeader that carries the key
OpenAI formathttps://token.echohub.io/v1Authorization: Bearer KEY
Anthropic formathttps://token.echohub.iox-api-key: KEY or Authorization: Bearer KEY
  • The x-api-key header works on the Anthropic-format endpoints (/v1/messages, and /v1/models when it returns the Anthropic-format list). Other endpoints use the Authorization header
  • The Anthropic format also requires the anthropic-version header (for example 2023-06-01). The Anthropic SDK sends it automatically
  • Only HTTPS is accepted
  • If the path you call has no /v1, you get HTTP 404 (the website's HTML page, not JSON) even with a correct key. If it has /v1 twice, you get HTTP 404 (a JSON Invalid URL error)

Base URL for each SDK and tool

Some SDKs need /v1 in the base URL and some add /v1 themselves. In the "Checked" column, "Yes" means we confirmed calls in Echo's test environment on 2026-09-27, and "No" means the value is based on the tool's official documentation.

SDK or toolSettingValueChecked
OpenAI SDK (Python, Node.js)base_url, baseURLhttps://token.echohub.io/v1Yes
Anthropic SDK (Python, Node.js)base_url, baseURLhttps://token.echohub.ioYes
Vercel AI SDK @ai-sdk/openai-compatiblebaseURLhttps://token.echohub.io/v1. To receive token counts, also set includeUsage: trueYes
Vercel AI SDK @ai-sdk/openaibaseURLhttps://token.echohub.io/v1. The default is the Responses API; .chat() uses the Chat Completions APIYes
Vercel AI SDK @ai-sdk/anthropicbaseURLhttps://token.echohub.io/v1. Unlike the Anthropic SDK, include /v1Yes
LangChain ChatOpenAIbase_url (configuration.baseURL in TypeScript)https://token.echohub.io/v1Yes
LangChain ChatAnthropicbase_url (clientOptions.baseURL in TypeScript)https://token.echohub.ioYes
LlamaIndex OpenAILikeapi_basehttps://token.echohub.io/v1. Also set is_chat_model=True and context_windowYes
LlamaIndex Anthropicbase_urlhttps://token.echohub.io. Only model names that LlamaIndex knows can be usedYes
Claude CodeEnvironment variable ANTHROPIC_BASE_URLhttps://token.echohub.io (Claude Code)Yes
Codex CLIbase_url in config.tomlhttps://token.echohub.io/v1, wire_api = "responses" (Codex CLI)Yes
Cursor, Cline, Dify, Continue, Roo Code, n8nThe base URL setting (Base URL or similar)https://token.echohub.io/v1No

Endpoints

Method and pathFormatWhat it doesModels offered
POST /v1/chat/completionsOpenAIContinues a conversation (Chat Completions API)Model list
POST /v1/responsesOpenAIGenerates a response (Responses API)Model list
POST /v1/messagesAnthropicContinues a conversation (Messages API)Model list
GET /v1/modelsOpenAI, AnthropicReturns the models the key can use—
POST /v1/embeddingsOpenAIConverts text into a sequence of numbers (embeddings)Model list
POST /v1/completionsOpenAIContinues a text (the older Completions API)Model list
POST /v1/images/generationsOpenAIGenerates imagesModel list
POST /v1/audio/speechOpenAITurns text into speechModel list
POST /v1/moderationsOpenAIChecks whether text violates a usage policyModel list
POST /v1/videosOpenAISubmits a video generation taskVideo generation
GET /v1/videos/{task ID}OpenAIReturns the progress of a video generation task—
GET /v1/videos/{task ID}/contentOpenAIReturns the finished video file—

Not available

FeatureStatus
Token counting (POST /v1/messages/count_tokens)Not supported. Returns HTTP 404
Files (/v1/files), Batch API (/v1/batches), fine-tuningNot supported. POST /v1/batches returns HTTP 404 and GET /v1/files returns HTTP 400
Image variations (POST /v1/images/variations)Not supported
Gemini format (/v1beta/models/...)Not supported. Returns HTTP 401
Balance (/v1/dashboard/billing/...)Not supported. Returns HTTP 404. Check your balance in the console
Information about one model (GET /v1/models/{モデル ID})May return incorrect results. Even for a model we offer, it can return HTTP 200 with an error body saying does not exist. Use GET /v1/models to check models

Not tested

FeatureStatus
POST /v1/responses/compactPassed to the upstream API as is. The response has not been checked
Speech to text (POST /v1/audio/transcriptions)Not checked
Realtime API (/v1/realtime)Not checked

Model IDs

Put the ID of the model to call in model in the request. Echo model IDs are written the same way as the names used in the provider's API (for example deepseek-flash, claude-sonnet-5). The exact IDs are listed on each model's page in the model list.

You can also get the IDs of the models your key can use with GET /v1/models. With both the x-api-key and anthropic-version headers it returns the Anthropic-format list; otherwise it returns the OpenAI-format list.

bash
curl "https://token.echohub.io/v1/models" \
  -H "Authorization: Bearer $ECHO_API_KEY"

Formats and models

You can call a model in a format different from its provider's. In that case, Echo's server converts the request and the response. After conversion, some parameters have no effect and some response fields differ from the provider's specification. We recommend calling each model in its provider's format.

ModelRecommended format
Claude (Anthropic)Anthropic format (/v1/messages)
OpenAIOpenAI format (/v1/chat/completions or /v1/responses)
OthersOpenAI format (/v1/chat/completions)

What changes with conversion (checked in Echo's test environment on 2026-09-27):

CombinationWhat changes
Calling a Claude model with /v1/chat/completionsresponse_format (structured output) has no effect. reasoning_effort is replaced with Claude's thinking setting. If you do not set max_tokens, it is 8,192. Input token counts are returned the OpenAI way, including cached tokens
Calling a Claude or Gemini model with /v1/responsesWorks, but some response fields differ from the OpenAI specification
Calling an OpenAI or Gemini model with /v1/messagesText, tool calls and streaming work. Some response fields differ from the Anthropic specification
Any combinationusage in the response may contain fields that are not in the provider's specification. Do not use those fields

This conversion also happens when you call a Claude model from a tool that only uses the OpenAI format, such as Cline, Cursor and Dify.

Call the Anthropic format with curl

bash
curl "https://token.echohub.io/v1/messages" \
  -H "x-api-key: $ECHO_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 1024,
    "messages": [{"role": "user", "content": "日本の首都はどこですか?"}]
  }'

Call the Responses API

Python
import os
from openai import OpenAI

client = OpenAI(
    base_url="https://token.echohub.io/v1",
    api_key=os.environ["ECHO_API_KEY"],
)

response = client.responses.create(
    model="gpt-6-sol",
    input="日本の首都はどこですか?",
)
print(response.output_text)

Streaming

Streaming means receiving the answer piece by piece while the model writes it. Add "stream": true to the request and the answer is returned as SSE (a mechanism for receiving data from the server one event at a time). Echo forwards the data from the upstream API in order, without buffering it.

FormatWhat arrives
OpenAI format (Chat Completions)A series of data: {...} lines, ending with data: [DONE]. With include_usage set to true in stream_options, token counts arrive before [DONE]
OpenAI format (Responses API)Events such as response.created, response.output_text.delta and response.completed
Anthropic formatmessage_start, content_block_start, content_block_delta, content_block_stop, message_delta and message_stop, in that order. ping may arrive in between. Token counts are in message_delta

What arrives when the upstream API returns an error or the connection is cut in the middle of an answer, and how to check, is in "When streaming stops partway" in Errors and fixes.

bash
curl -N "https://token.echohub.io/v1/chat/completions" \
  -H "Authorization: Bearer $ECHO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-flash",
    "stream": true,
    "stream_options": {"include_usage": true},
    "messages": [{"role": "user", "content": "自己紹介を 3 文でしてください。"}]
  }'

Main parameters

The available parameters and value ranges differ by model. Follow each provider's documentation.

Chat Completions (POST /v1/chat/completions)

ParameterRequiredDescription
modelRequiredModel ID
messagesRequiredThe conversation so far: pairs of role (system, user, assistant and so on) and content
streamtrue to stream
stream_options{"include_usage": true} to receive token counts at the end of a stream
max_completion_tokensThe maximum number of output tokens. The older max_tokens is deprecated by OpenAI
temperature, top_pHow varied the output is
stopStrings that stop the output
tools, tool_choiceDefinitions and selection for tool calls (the model calling external functions)
response_formatThe output format, such as JSON. Has no effect on Claude models (see "Formats and models" above)
reasoning_effortHow deeply the model reasons before answering. Supported models only

Messages (POST /v1/messages)

ParameterRequiredDescription
modelRequiredModel ID
messagesRequiredThe conversation so far: pairs of role (user, assistant) and content
max_tokensRequiredThe maximum number of output tokens
systemThe system prompt (background instructions for the model)
streamtrue to stream
temperature, top_p, top_kHow varied the output is. Anthropic's documentation deprecates temperature and top_k for newer models
stop_sequencesStrings that stop the output
tools, tool_choiceDefinitions and selection for tool calls
thinkingSettings for extended thinking (reasoning before answering). Supported models only
metadataInformation attached to the request, such as an ID that identifies the user. Echo passes it to the upstream unchanged

Echo removes three parameters, inference_geo, service_tier and speed, before passing the request to the upstream. The processing region is fixed for each model (Data handling).

Responses (POST /v1/responses)

ParameterRequiredDescription
modelRequiredModel ID
inputThe input: a string or an array of conversation items
instructionsInstructions for the system
streamtrue to stream
max_output_tokensThe maximum number of output tokens
tools, tool_choiceDefinitions and selection for tool calls
reasoningReasoning settings. Supported models only
storeWhether the upstream API stores the response. Echo passes it on unchanged. In the OpenAI API it defaults to true (stored)
previous_response_idTreats the request as a continuation of an earlier response (not tested through Echo)

Embeddings

bash
curl "https://token.echohub.io/v1/embeddings" \
  -H "Authorization: Bearer $ECHO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "[埋め込みモデルの ID]", "input": "東京は日本の首都です。"}'

You can find models that support embeddings in the model list. Both number arrays and base64 are supported.

Balance, usage and limits

  • Check your balance and usage in the console (API keys and usage). There is currently no way to get your balance through the API
  • Per-key spending limits, rate limits and the request size limit are in Limits and rate limits

Sources

WhatSourceChecked
Calls to each endpoint, unavailable features and their HTTP statuses, 401 and 404 depending on /v1, the base URL for each SDK and tool (rows marked "Yes"), what changes with format conversion, forwarding of streams, removal of inference_geo and others, passing store on unchangedMeasured in Echo's test environment, with the same relay settings as production and a server that returns test responses in place of the upstream API2026-09-27
The three video generation endpoints (/v1/videos)Measured in Echo's test environment (as above, with a server that returns test responses in place of the provider's API)2026-10-01
The base URL settings of Cline, Cursor, Dify, Continue, Roo Code and n8nhttps://docs.cline.bot/provider-config/openai-compatible , https://cursor.com/docs/settings/api-keys , https://github.com/langgenius/dify-official-plugins/tree/main/models/openai_api_compatible , https://docs.continue.dev/customize/model-providers/top-level/openai , https://roocodeinc.github.io/Roo-Code/providers/openai-compatible , https://docs.n8n.io/integrations/builtin/credentials/openai2026-09-27
Chat Completions parameters, stream_options and [DONE], deprecation of max_tokenshttps://developers.openai.com/api/reference/resources/chat2026-09-26
Streaming events of the Responses APIhttps://developers.openai.com/api/docs/guides/streaming-responses2026-09-26
The default of store in the Responses API (true when not set)https://developers.openai.com/api/reference/resources/responses/methods/create2026-09-27
Messages API parametershttps://platform.claude.com/docs/en/api/messages2026-09-26
Messages API streaming events, messages.stream in the SDKhttps://platform.claude.com/docs/en/build-with-claude/streaming2026-09-26