> ## Documentation Index
> Fetch the complete documentation index at: https://docs.datadingo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication and credits

> API tokens, errors and how credits are charged.

## API tokens

Every API request sends a bearer token:

```bash theme={null}
Authorization: Bearer dd_live_...
```

Create and revoke tokens on the [Connect page](https://app.datadingo.com/connect). Treat a token like a password: keep it on your server, never in a browser or app bundle. If one leaks, revoke it and create a new one.

AI agents don't need a token: they sign in with OAuth when you [connect them](https://docs.datadingo.com/connect-an-ai-agent.md).

## Credits

Your account has one credit balance, shared by the app, AI agents and the API.

| Action | Cost |
| - | - |
| A full company record, the first time your account gets it | 1 credit |
| The same company again | Free |
| Search and result counts | Free |

Your balance and recent usage are on the [Credits page](https://app.datadingo.com/credits). Plans and credit packs are on the [pricing page](https://app.datadingo.com/pricing).

## Errors

Errors use one shape:

```json theme={null}
{ "error": 401, "message": "..." }
```

| Status | Meaning |
| - | - |
| `400` | The request is invalid. The message names the field, including any field the endpoint doesn't accept. |
| `401` | The token is missing, wrong or revoked. |
| `402` | Not enough credits. Top up or wait for your monthly allowance. |
| `403` | Your plan has ended. Subscribe to keep using DataDingo. |
| `404` | No company matches. |
| `429` | Too many requests, or today's free search results are used up. Slow down and retry later. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.