Skip to main content

API Keys

Dedaub has two products with an API. Each product has its own key:

  • Tok{In} (token safety) at tokin.dedaub.com. Its API is at https://tokin-api.dedaub.com.
  • The Dedaub app at app.dedaub.com. Its API is at https://api.dedaub.com.

Find the task in the table below. Then get the key from the place that the table shows.

Which key do I need?​

You want toYou needGet it atSend it as
Check tokens with the Tok{In} APIA Tok{In} keytokin.dedaub.com: sign in, then API KeysX-API-Key header
Try Tok{In} from an AI agent, with no person to sign inA Tok{In} trial keyPOST https://tokin-api.dedaub.com/agent-keys (details)X-API-Key header
Decompile bytecode with the Decompiler APIA Dedaub key (personal or organization)app.dedaub.com: Profile > API Keys, or your organization pageX-API-Key header
Call the projects and protocols API at api.dedaub.com (most protocol routes need a Watchdog plan)A Dedaub key (personal or organization)The same as for the Decompiler APIX-API-Key header
Use the monitoring CLINo keyRun dedaub-monitoring login and sign in in the browserNot necessary
Make sure that a webhook comes from DedaubA webhook secret, which Dedaub sends to youYou choose it when you add the webhookDedaub sends it in the x-webhook-secret header
A Tok{In} key and a Dedaub key are not the same

A Tok{In} key does not work on api.dedaub.com, and a Dedaub key does not work on tokin-api.dedaub.com. If an API refuses your key, first make sure that you use the key of the correct product.

The Tok{In} key​

You get a Tok{In} key on tokin.dedaub.com, not on app.dedaub.com.

  1. Go to tokin.dedaub.com/login and sign in with Google or GitHub.
  2. In the dashboard menu, click API Keys.
  3. Click Create Key, then click Generate Key in the Create New API Key dialog.
  4. Copy the key from the Active Keys table: click the copy icon next to the key.

The Create New API Key dialog

The API Keys page of the TokIn dashboard, with a new key

Send the key in the X-API-Key header of each request:

curl 'https://tokin-api.dedaub.com/token/ethereum/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' \
-H 'accept: application/json' \
-H 'X-API-Key: YOUR-TOKIN-KEY'

Things to know:

  • Number of keys. Your plan sets the maximum number of keys. When you have the maximum, delete a key before you create a new one. On a company plan, the keys of all the users of your company domain count together.
  • Expiry. On some plans, such as the free plan, a key expires. Then the Create New API Key dialog shows the period, and the Expires column shows the date. Create the new key before the old key expires. Each response to a key with an expiry date has the header X-API-Key-Expires-At.
  • Limits. Your plan sets the number of calls for each minute, day and month. The Billing page of the dashboard shows them, with the calls that you used. When you are above a limit, the API answers 429. See Rate limiting.

A trial key for an AI agent​

An AI agent cannot sign in, because sign-in needs a person. The agent can get a small trial key without sign-in:

curl -X POST 'https://tokin-api.dedaub.com/agent-keys' \
-H 'Content-Type: application/json' \
-d '{"reason": "Screen tokens before a user buys them", "contact": "[email protected]"}'

The trial key has a small number of calls and an expiry date. The API gives one trial key for each client network. For the limits and the errors, see For AI Agents.

The Dedaub key​

A Dedaub key signs your requests to https://api.dedaub.com. Use it for the Decompiler API and for the projects and protocols API.

There are two types of Dedaub key. Both work in the same way:

Personal keyOrganization key
Who can create itEach userEach member of the organization
Number of keysOne for each userOne for each member, in each organization
Who pays for the callsYour accountThe organization
Where to create itProfile > API KeysThe organization page > API Keys

The app shows a new key one time only. Copy it at once and keep it in a safe place. Dedaub cannot show the key again. If you lose a key, create a new one.

Create a personal key​

  1. Sign in at app.dedaub.com.
  2. Open the account menu at the top right, and click Profile.
  3. Click API Keys. The Manage API Keys panel opens.
  4. Click New Key, then click Yes, generate key.
  5. Copy the key from the Your new API key field.

The Profile page with the API Keys button

The Manage API Keys panel with a new key

You can have one personal key. A new key replaces your old key, and the old key stops working at once. To remove your key, click Delete in the same panel.

Create an organization key​

An organization key calls the API as you, and it spends the credits of the organization.

  1. Go to app.dedaub.com/organizations (or open the account menu at the top right and click Organizations). Then open your organization.
  2. Click Create API Key.
  3. Optional: type a Name for the key, for example "CI pipeline".
  4. Click Create, and copy the key.

The API Keys section of an organization

The Create API Key panel

You can have one key in each organization. A new key disables your old key in that organization. A manager of the organization sees the keys of all members and can delete them. When a member leaves the organization, the keys of that member stop working.

Use the Dedaub key​

Send the key in the X-API-Key header:

curl -X POST 'https://api.dedaub.com/api/on_demand' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: YOUR-DEDAUB-KEY' \
-d '"0x6080604052..."'

Do not send an Authorization: Bearer header together with the key. The API refuses a request with both (400).

API credits​

The Decompiler API uses API credits:

  • A decompilation costs 1 credit for each bytecode that is new to your account (or to your organization, for an organization key). A second request for the same bytecode is free.
  • Your credits are your monthly allowance (from a subscription) plus the credits that you buy. The Billing page of app.dedaub.com shows your Credit balance.
  • To get more credits, go to the API Credits page.
  • When the balance is too low, the API answers 402. The detail object of the answer has your balance and the required credits.

Errors​

CodeMeaningWhat to do
401The key is missing, unknown, deleted or expired.Make sure that you send the key of the correct product (see the table above), in the X-API-Key header. Create a new key if necessary.
402Not sufficient API credits (Dedaub key), or the free quota is used (Tok{In} trial key).Dedaub key: add credits. Tok{In} trial key: sign in at tokin.dedaub.com and create a full key.
403Your plan or your role does not allow this request, or the account is blocked.Change your plan, ask a manager of your organization, or contact Dedaub.
429Too many requests.Wait for the time in the Retry-After header, then send again. If the answer says Too many invalid credentials, your key is wrong: correct the key first.