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

DocsAPI keys and usage

API keys and usage

Issuing, showing, stopping and deleting API keys in the console, spending limits, reading usage and the call history, and balance and top-ups.

The console (https://token.echohub.io/console ) is where you manage API keys and usage. You log in with your Echo AI Hub account.

The console is available in Japanese and English. Switch the language with 日本語・English at the top right of the console (on a phone, at the bottom of the menu). Labels on this page are as they appear in the English console.

MenuWhat you can do
Getting startedCheck three things in order: balance, API key and first call. Shown until your first call succeeds
UsageSee the amount spent, number of requests and tokens for a period, and usage by day, by model and by key
Call historySee a record of each call. You can filter it and export it as CSV
API keysIssue and show keys, change their name and spending limit, stop and resume them, delete them
Balance and top-upSee your balance, its breakdown and top-up history, and top up
Models and pricingOpen the model list
DocsOpen this documentation

Right after you sign up, the console shows Preparing API access. When it is ready, the screen switches automatically. If it takes a while, reopen the page after a few minutes.

Issue an API key

  1. Open API keys in the menu and click Issue key
  2. In Name, enter a name that shows what the key is for (for example, production server). Up to 16 full-width or 50 half-width characters. You cannot create two keys with the same name
  3. To limit how much this key can spend, enter an amount in Spending limit (JPY). If you leave it empty, the key can be used up to your account balance
  4. To limit which models, source IP addresses or dates the key works for, open Set restrictions (see Key restrictions). If you skip it, nothing is restricted
  5. Click Issue and the key is shown. Click Copy key and store it somewhere safe
  • A key is a string that starts with sk-
  • After issuing, you can show the key again with "Show key" in its menu in the list, up to 10 times per hour
  • One account can issue up to 1,000 keys (provisional). You can issue up to 20 keys per hour

If you use separate keys for each purpose (production server, local development, each tool and so on), you can stop just that key when something goes wrong.

Note: Do not show your key to anyone. Do not put it in a public repository or in code that runs in the browser.

The key list

The list in API keys shows the following for each key.

ItemContents
NameThe key's name. The first and last 4 characters of the key, and any restrictions set (models, source IP, expiry), are shown below it
StatusActive, Stopped, Expired, Limit reached
Spending limitThe remaining limit. Keys without a limit show No limit
Spent with this keyThe total amount spent with this key
Last usedWhen the key was last used. Keys not used yet show Unused
CreatedWhen the key was created

Key actions

The menu at the right end of each row in the list has the following actions.

ActionResult
Show keyShows the whole key
RenameChanges the key's name. Past records keep showing the old name
Change spending limitChanges how much this key can spend from now on. Leave it empty for no limit
Change restrictionsChanges the allowed models, source IP addresses and expiry date (see Key restrictions)
StopStops calls with this key. You can undo it with Resume
DeleteDeletes the key. This cannot be undone. To confirm, you type the key's name

Calls with a stopped or deleted key return HTTP 401. After you delete a key, its past usage records stay in the call history.

If a key leaks, stop or delete it right away and issue a new key.

Key restrictions

With Set restrictions when issuing a key, or Change restrictions in the list menu, you can set the following three items. Changes apply from the next request. You do not need to replace the key.

ItemHow to set itWhen it is not met
Allowed modelsAll models (the default) or Only selected models. You can choose from the models your account can use nowCalling a model you did not select returns HTTP 403
Source IPOne allowed IP address per line. IPv4 (for example 203.0.113.5), IPv6 (for example 2001:db8::5), and ranges in CIDR (for example 203.0.113.0/24). Add your current address: … adds the address of the browser you are using now. If empty, the key can be called from anywhereCalling from an address not listed returns HTTP 403
ExpiryNone (the default) or a date. The key works until 23:59:59 (Japan time) on that date. You cannot pick a date before todayAfter expiry, calls return HTTP 401 and the status in the list is Expired
  • Limiting the models does not change prices (Premium and individual prices still apply)
  • In Source IP, write the IP address of the server that uses the key. Add your current address is your browser's address, which may differ from the server
  • An expired key resumes as the same key if you extend the date or set it to None with Change restrictions
  • Keys received at a Token Bar store show Managed by Token Bar and cannot be changed in the console

Spending limits

The Spending limit you enter when issuing a key, or with Change spending limit, is the maximum amount the key can spend. It goes down as you use it and is never reset automatically.

When a key reaches its limit, its status changes to Limit reached and a Change spending limit button appears in its row. If you raise the limit, the key resumes automatically. You do not need to replace the key in your program.

The errors returned when a key is close to or at its limit are in Limits and rate limits.

Check your usage

In Usage in the menu, choose a period to see the following. Times are Japan time.

ItemContents
Period totalAmount spent, number of requests, number of tokens
Spending by dayA chart of the amount spent each day
By modelRequests and amount spent for each model
By keyRequests and amount spent for each key name

The totals, daily figures and per-model figures are aggregated every hour. The latest calls can take up to 5 minutes to appear.

Check the call history

Call history in the menu shows a record of each call, newest first. The text of requests and model answers is not shown. What we record is described in Data handling.

ItemContents
ListTime, result (success or failure), key, model, amount, request ID
DetailsWhat failed and what to do, HTTP status, input tokens, output tokens, duration, whether it was streamed
FilterPeriod, result, key, model ID, request ID
Export CSVExports one month of records as CSV. The request text is not included

Records can take a few seconds to appear.

Video generation tasks

Each video generation task (Video generation) is shown as one row.

ItemContents
StateOne of Waiting, Generating, Completed and Failed, refunded. While generating, the time since you submitted the task is shown too (for example Generating · 1 min 20 s)
AmountUntil generation finishes, the estimated amount deducted at submission. After that, the recalculated amount. Failed tasks have been refunded in full
OpenIn the row of a completed task. Opens the generated video
ExpiredShown in the row of a task whose file the provider no longer keeps. The video can no longer be opened

Balance and top-ups

In Balance and top-up in the menu, you can see your current balance, how much of it is bonus credit, and the nearest expiry date.

ItemContents
BreakdownFor top-ups and bonus credit: date granted, amount granted, amount left and expiry date. The balance with the nearest expiry is used first
Top-up historyDate, amount (tax included), receipt

The breakdown and the top-up history are shown after the member site Echo AI Hub opens.

To top up:

  1. Click Top up in Balance and top-up. When your balance is low or zero, you can also use Top up in the line at the top of each page
  2. Choose an amount, or enter a whole-dollar amount in Other amount, and click Continue to payment. The same screen shows your balance after each top-up amount, what to check before you pay (the amount added to your balance, when it is added, expiry, refunds) and links to Terms of Use and Specified Commercial Transactions Act notice (both pages are in Japanese)
  3. You are taken to the Stripe payment page. Pay by credit card. Stripe emails you the receipt
  4. When the payment is done, you return to the page where you clicked Top up. It can take a few seconds to about a minute before the balance is updated. The screen refreshes automatically when it is

Top-up amounts, expiry, invoices and receipts are in Pricing and top-ups.

Amounts in the console (balance, usage, call history, spending limits and amounts spent with each key) are shown in US dollars, with the yen amount in smaller type. The US dollar figure is the yen amount converted at Echo's exchange rate. Your balance, charges and spending limits are in yen, and you enter spending limits in yen. You pay for top-ups in US dollars (the amount you choose and the payment amount are in US dollars). The payment is added to your balance in yen at the exchange rate at the time of payment (the same rate used for the US dollar amounts on this screen).