Quickstart
The three steps of signing up, topping up and issuing an API key, and your first API call.
Follow the steps on this page to go from signing up to your first API call. There are three steps: sign up, top up, and issue a key.
Sign-up is free, but calling the API requires a balance (top-ups start from ¥1,000). Sign-up bonus: [ ]
Choose how to connect
| How you use it | Base URL | Where to read |
|---|---|---|
| OpenAI SDK | https://token.echohub.io/v1 | This page |
| Anthropic SDK | https://token.echohub.io (without /v1) | This page |
| Claude Code | https://token.echohub.io (without /v1) | Claude Code |
| Codex CLI | https://token.echohub.io/v1 | Codex CLI |
| Cursor, Cline, Dify and other tools that support the OpenAI format | https://token.echohub.io/v1 | Cursor, Cline, Dify |
| Switch existing SDK code to Echo | Same as each SDK | "Switch your existing code" on this page |
Both formats use the same API key. Base URLs for other SDKs and tools are in "Base URL for each SDK and tool" in the API reference.
1. Create an account
You can create an account after the member site Echo AI Hub opens. As of 2026-09-28 the member site has not opened, so you cannot sign up or log in yet.
After it opens, the steps are as follows.
- Open the console (https://token.echohub.io/console ). You are taken to the Echo AI Hub login screen
- Sign up or log in on the Echo AI Hub screen. The account is shared by both sites
- When you finish, you return to the Echo Token Station console (the management screen for issuing API keys and checking usage)
The console is available in Japanese only. In the steps below, labels in the console are written in Japanese, followed by an English translation in parentheses.
Right after you sign up, the console shows 「API の利用を準備しています」 (Preparing API access). When it is ready, the screen switches automatically.
2. Top up
- In the console menu, open 「残高とチャージ」 (Balance and top-up) and click 「チャージする」 (Top up)
- Choose an amount and click 「お支払いへ進む」 (Continue to payment). You are taken to the Stripe payment page. Pay by credit card
- When the payment is done, you return to 「残高とチャージ」 in the console. It can take a few seconds to about a minute before the balance is updated. The screen refreshes automatically when it is
Amounts, expiry and the order in which balances are used are in Pricing and top-ups.
3. Issue an API key
- In the console menu, open 「APIキー」 (API keys) and click 「キーを発行」 (Issue key)
- In 「名前」 (Name), enter a name that shows what the key is for (for example, production server). To limit how much the key can spend, also fill in 「利用上限(円)」 (Spending limit (JPY))
- Click 「発行する」 (Issue) and the key is shown. Click 「キーをコピー」 (Copy key) and store it. A key is a string that starts with
sk-
The screen that shows the new key also shows code for a first call with that key filled in.
Note: Do not show your key to anyone. Do not put it in a public repository or in code that runs in the browser. If a key leaks, stop it in the console.
Your first call
Put the key in an environment variable
An environment variable is a named value set on your computer or server, so that you do not have to write the key in your code. This documentation uses the name ECHO_API_KEY.
# macOS・Linux
export ECHO_API_KEY="sk-..."# Windows(PowerShell)
$env:ECHO_API_KEY = "sk-..."Install an SDK and call the API
Choose a language and SDK in the tabs below. The tab you choose is kept on the other pages of this documentation. The model ID (the string that selects which model to call) is an example: the OpenAI-format examples use deepseek-flash and the Anthropic-format examples use claude-sonnet-5. You can find the IDs of available models in the model list.
This calls the API in the OpenAI format.
curl "https://token.echohub.io/v1/chat/completions" \
-H "Authorization: Bearer $ECHO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-flash",
"messages": [
{"role": "user", "content": "日本の首都はどこですか?"}
]
}'# Create and activate a virtual environment
python3 -m venv .venv && source .venv/bin/activate
pip install openaiimport os
from openai import OpenAI
client = OpenAI(
base_url="https://token.echohub.io/v1",
api_key=os.environ["ECHO_API_KEY"],
)
completion = client.chat.completions.create(
model="deepseek-flash",
messages=[{"role": "user", "content": "日本の首都はどこですか?"}],
)
print(completion.choices[0].message.content)npm install openaiimport OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://token.echohub.io/v1",
apiKey: process.env.ECHO_API_KEY,
});
const completion = await client.chat.completions.create({
model: "deepseek-flash",
messages: [{ role: "user", content: "日本の首都はどこですか?" }],
});
console.log(completion.choices[0].message.content);Save it as index.ts and run it with npx tsx index.ts.
# Create and activate a virtual environment
python3 -m venv .venv && source .venv/bin/activate
pip install anthropicimport os
import anthropic
client = anthropic.Anthropic(
base_url="https://token.echohub.io",
api_key=os.environ["ECHO_API_KEY"],
)
message = client.messages.create(
model="claude-sonnet-5",
max_tokens=1024,
messages=[{"role": "user", "content": "日本の首都はどこですか?"}],
)
print(message.content[0].text)The Anthropic SDK adds /v1/messages after the base URL automatically. Do not add /v1 to base_url.
npm install @anthropic-ai/sdkimport Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://token.echohub.io",
apiKey: process.env.ECHO_API_KEY,
});
const message = await client.messages.create({
model: "claude-sonnet-5",
max_tokens: 1024,
messages: [{ role: "user", content: "日本の首都はどこですか?" }],
});
const block = message.content[0];
if (block.type === "text") {
console.log(block.text);
}The Anthropic SDK adds /v1/messages after the base URL automatically. Do not add /v1 to baseURL. Save it as index.ts and run it with npx tsx index.ts.
A successful response
If the text of the answer is shown, the call succeeded. With curl, you get JSON like the following (the ID, time and token counts are examples).
{
"id": "chatcmpl-...",
"object": "chat.completion",
"created": 1790000000,
"model": "deepseek-flash",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "日本の首都は東京です。"},
"finish_reason": "stop"
}
],
"usage": {"prompt_tokens": 16, "completion_tokens": 9, "total_tokens": 25}
}The call appears in 「呼び出し履歴」 (Call history) in the console with its time, model, token counts and amount. It can take a few seconds to appear.
If you get an error, look up the HTTP status and the error body in Errors and fixes. If you get 401 even though the key is correct, check the /v1 in the base URL.
Switch your existing code
For code that uses the OpenAI or Anthropic SDK, change three things: the base URL, the API key and the model ID.
| What to change | OpenAI SDK | Anthropic SDK |
|---|---|---|
| Base URL | Set base_url (baseURL in TypeScript) to https://token.echohub.io/v1 | Set base_url (baseURL in TypeScript) to https://token.echohub.io |
| API key | Your Echo API key | Your Echo API key |
| Model ID | An Echo model ID | An Echo model ID |
These are the changes for the Python OpenAI SDK.
client = OpenAI(
- api_key=os.environ["OPENAI_API_KEY"],
+ base_url="https://token.echohub.io/v1",
+ api_key=os.environ["ECHO_API_KEY"],
)You can also switch with environment variables without changing the code. The OpenAI SDK reads OPENAI_BASE_URL and OPENAI_API_KEY, and the Anthropic SDK reads ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY.
# OpenAI の SDK
export OPENAI_BASE_URL="https://token.echohub.io/v1"
export OPENAI_API_KEY="$ECHO_API_KEY"
# Anthropic の SDK
export ANTHROPIC_BASE_URL="https://token.echohub.io"
export ANTHROPIC_API_KEY="$ECHO_API_KEY"Start with an AI coding tool
To let Claude Code, Cursor or another tool do the setup, give it the following text as is.
Set up this project to use the Echo Token Station API.
- Base URL for the OpenAI format: https://token.echohub.io/v1
- Base URL for the Anthropic format: https://token.echohub.io (the Anthropic SDK adds /v1/messages. Only when using @ai-sdk/anthropic, specify https://token.echohub.io/v1)
- Read the API key from the environment variable ECHO_API_KEY. Do not write the key in code or in the repository
- Model ID to use: deepseek-flash (an example. Available models are listed at https://token.echohub.io/models )
- Documentation index: https://token.echohub.io/llms.txtRead next
| Page | Contents |
|---|---|
| Tool setup | Claude Code, Codex CLI, Cursor, Cline, Dify, LangChain |
| API keys and usage | Showing, stopping and deleting keys, spending limits, reading usage and the call history |
| API reference | Endpoints, streaming, main parameters |
| Errors and fixes | The error body format and what to do in each case |
Sources
| What | Source | Checked |
|---|---|---|
Base URLs and whether to include /v1, the 404 without /v1 (rechecked on 2026-10-11), calls from each SDK (OpenAI SDK: Python 2.54.0, Node.js 7.23.0; Anthropic SDK: Python 1.8.0, Node.js 0.128.0) | Measured in Echo's test environment, with the same relay settings as production and a server that returns test responses in place of the upstream API | 2026-09-27 |
base_url and baseURL in the OpenAI SDK, the environment variables OPENAI_BASE_URL and OPENAI_API_KEY | https://github.com/openai/openai-python , https://github.com/openai/openai-node | 2026-09-27 |
base_url and baseURL in the Anthropic SDK, adding /v1/messages, the environment variables ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY | https://github.com/anthropics/anthropic-sdk-python , https://github.com/anthropics/anthropic-sdk-typescript | 2026-09-27 |
@ai-sdk/anthropic needs /v1 in the base URL | Measured in Echo's test environment | 2026-09-27 |
| The flow of signing up and issuing a key, labels on the screens, the delay before the balance updates, 「API の利用を準備しています」 right after sign-up | The Echo Token Station console (screens as of 2026-09-28) | 2026-09-28 |
| The top-up flow (the screen for choosing an amount, moving to the Stripe payment page, the page you return to) | Measured in Echo's test environment, with test servers in place of the member site Echo AI Hub and Stripe | 2026-10-01 |