BLACK FRIDAYUntil Dec 8 (Tue) 23:59 JSTUntil Dec 8

DocsQuickstart

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 itBase URLWhere to read
OpenAI SDKhttps://token.echohub.io/v1This page
Anthropic SDKhttps://token.echohub.io (without /v1)This page
Claude Codehttps://token.echohub.io (without /v1)Claude Code
Codex CLIhttps://token.echohub.io/v1Codex CLI
Cursor, Cline, Dify and other tools that support the OpenAI formathttps://token.echohub.io/v1Cursor, Cline, Dify
Switch existing SDK code to EchoSame 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.

  1. Open the console (https://token.echohub.io/console ). You are taken to the Echo AI Hub login screen
  2. Sign up or log in on the Echo AI Hub screen. The account is shared by both sites
  3. 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

  1. In the console menu, open Balance and top-up and click Top up
  2. Choose an amount and click Continue to payment. You are taken to the Stripe payment page. Pay by credit card
  3. 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

  1. In the console menu, open API keys and click Issue key
  2. 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)
  3. 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.

bash
# macOS・Linux
export ECHO_API_KEY="sk-..."
PowerShell
# 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.

bash
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?"}
    ]
  }'

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).

JSON
{
  "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 changeOpenAI SDKAnthropic SDK
Base URLSet base_url (baseURL in TypeScript) to https://token.echohub.io/v1Set base_url (baseURL in TypeScript) to https://token.echohub.io
API keyYour Echo API keyYour Echo API key
Model IDAn Echo model IDAn Echo model ID

These are the changes for the Python OpenAI SDK.

diff
 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.

bash
# 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.

Text
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.txt
PageContents
Tool setupClaude Code, Codex CLI, Cursor, Cline, Dify, LangChain
API keys and usageShowing, stopping and deleting keys, spending limits, reading usage and the call history
API referenceEndpoints, streaming, main parameters
Errors and fixesThe error body format and what to do in each case