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 $10).
Choose how to connect
| How you use it | Base URL | Where to read |
|---|---|---|
| OpenAI SDK | https:/ | This page |
| Anthropic SDK | https:/ (without /v1) | This page |
| Claude Code | https:/ (without /v1) | Claude Code |
| Codex CLI | https:/ | Codex CLI |
| Cursor, Cline, Dify and other tools that support the OpenAI format | https:/ | 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
Your account is shared with the member site Echo AI Hub. You can sign up with an email address, Google or GitHub.
- 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 and English (switch at the top right). In the steps below, labels are written as they appear on the Japanese screen, followed by English in parentheses.
Right after you sign up, the console shows 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 Balance and top-up 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 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: both the OpenAI-format and Anthropic-format examples use claude-fable-5-1. 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": "claude-fable-5-1",
"messages": [
{"role": "user", "content": "What is the capital of Japan?"}
]
}'# 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="claude-fable-5-1",
messages=[{"role": "user", "content": "What is the capital of Japan?"}],
)
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: "claude-fable-5-1",
messages: [{ role: "user", content: "What is the capital of Japan?" }],
});
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-fable-5-1",
max_tokens=1024,
messages=[{"role": "user", "content": "What is the capital of Japan?"}],
)
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-fable-5-1",
max_tokens: 1024,
messages: [{ role: "user", content: "What is the capital of Japan?" }],
});
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": "claude-fable-5-1",
"choices": [
{
"index": 0,
"message": {"role": "assistant", "content": "The capital of Japan is Tokyo."},
"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:/ | Set base_url (baseURL in TypeScript) to https:/ |
| 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: claude-fable-5-1 (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 |