# Errors

> The difference between a refusal and an error in Atracode, and what to do about authentication, quota, invalid input and availability errors.

> Preview: the commands, tools and API shapes on this page may change before launch.

Source: https://atracode.com/docs/errors

Atracode reports two kinds of problem, and they mean very different things. A refusal is a compile result: the compiler ran and told you exactly what it could not verify. An error means the request did not run at all. The error classes and status codes on this page are previews and may change before launch.

## Refusals are results

When the compiler meets a construct it cannot model and check bit for bit, such as reading the clock, it stops at that construct and refuses. You get the exact file, line and column, the reason, and a hint:

```text
refused  rotate.sh:12:9  reads $(date), which differs on every run
  hint: pass the timestamp in as an argument and compile again
```

A refusal is a normal, successful response:

- The [CLI](/docs/cli) prints it in the format above.
- The [SDKs](/docs/sdks) return a result whose status is `refused`, with the refusal attached. They do not throw.
- The [MCP tools](/docs/mcp-tools) return `"status": "refused"` with a `refusal` object `{ file, line, column, reason, hint }`. The tool call succeeds.

To fix a refusal, change the code at the location given (usually by passing the value in as an input, as the hint says) and compile again. Retrying the same code returns the same refusal. [Refusals](/docs/refusals) covers the common causes.

A divergence from `verify-equivalence` works the same way: two programs that behave differently is an answer, not an error.

## Errors

An error means Atracode could not process the request. The CLI prints an error message, the SDKs raise or return an error in each language's usual way, and the MCP server reports a failed tool call. The HTTP status below is what the API returns underneath.

| Error | HTTP status | What it means |
| --- | --- | --- |
| Authentication failed | 401 | The API key is missing, malformed, rotated or revoked |
| Quota exhausted | 402 or 429 | The workspace has used its monthly compilations and cannot compile until reset |
| Invalid input | 400 | The request could not be understood |
| Service unavailable | 503 | The compiler could not take the request right now |

### Authentication failed

The request had no valid API key. Check that:

- `ATRACODE_API_KEY` is set in the environment the CLI, SDK or MCP server is actually running in.
- The key is complete and starts with `atc_live_`.
- The key has not been rotated or revoked. If it has, use the new key.

On your own machine, `atracode login` signs you in again through the browser. MCP clients need a restart after you change the key in their config. See [Authentication](/docs/authentication).

### Quota exhausted

This only happens on the Community plan. When a Community workspace uses its 250 monthly compilations, compiling pauses until the allowance resets, and every compile request returns this error. It applies to every client and every [agent stream](/docs/agent-streams) in the workspace.

Wait for the monthly reset, or move to a paid plan on the [pricing page](/pricing). On Pro Builder, Team & AI Studio and Enterprise Scale, compiling never pauses; extra compilations are billed at the plan's over-quota rate. See [Limits and quotas](/docs/limits-and-quotas).

### Invalid input

The request was malformed, so nothing was compiled. Common causes:

- Both `source` and `path` were given, or neither was.
- The file at `path` could not be read.
- No `language` was given with `source`, or the language could not be inferred from the file name.
- The language is not one Atracode supports. [Languages](/docs/languages) lists all 50.

Invalid input is different from a refusal. A refusal means the compiler read your program and found something it cannot verify. Invalid input means it never got that far. Fix the request and send it again.

### Service unavailable

The hosted compiler could not take the request. Nothing was compiled. Wait a moment and retry. If you call the API from your own code, retry with a growing delay between attempts.

> **Tip:** When you write instructions for an agent, tell it to fix the code after a refusal and to retry only after a service-unavailable error. Retrying a refusal or an authentication error without changing anything returns the same result.

## Next steps

- [Refusals](/docs/refusals): read and fix a refusal
- [Authentication](/docs/authentication): keys, login and rotation
- [Limits and quotas](/docs/limits-and-quotas): allowances and over-quota rates
- [MCP tools](/docs/mcp-tools): how results and errors come back to an agent
