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

# Configuration and troubleshooting

> Configure reliable OpenTooler execution for AI agents.

Use these settings and machine-readable contracts to make agent tool calls predictable and recoverable.

## Environment variables

| Variable                        | Purpose                                                      |
| ------------------------------- | ------------------------------------------------------------ |
| `OPENTOOLER_API_KEY`            | API key for unattended agents; overrides stored credentials. |
| `OPENTOOLER_API_BASE_URL`       | API base URL; default: `https://api.opentooler.ai/v1`.       |
| `OPENTOOLER_TELEMETRY_DISABLED` | Disable optional telemetry.                                  |

## JSON output contract

With `--json`, stdout contains one JSON document:

```json theme={null}
{
  "ok": true,
  "data": {},
  "meta": {}
}
```

Errors include a semantic exit code and a machine-readable payload that agents can use to choose a recovery action.

## Exit codes

| Code | Meaning                        | Recommended action                                     |
| ---: | ------------------------------ | ------------------------------------------------------ |
|    0 | Success                        | Continue.                                              |
|    2 | Usage or input error           | Fix the command or schema input.                       |
|    3 | Authentication required        | Run `opentooler auth login` or configure a key.        |
|    4 | Credits or policy blocked      | Check balance and top up if approved.                  |
|    5 | Tool unavailable               | Search or describe the tool again.                     |
|    6 | Invocation failed              | Read error details; do not blind-retry.                |
|    7 | Invocation timeout             | Get the invocation status instead of duplicating work. |
|    8 | Network or service unavailable | Retry safe reads after checking connectivity.          |
|    9 | Rate limited                   | Wait for the advised backoff period.                   |

## Diagnose setup

```bash theme={null}
opentooler doctor --json
```

`doctor` reports platform, architecture, CLI and protocol versions, credential presence, keychain availability, API reachability, latency, and video-transcription prerequisites.

<Warning>
  If a paid call returns `INVOCATION_ADMISSION_UNKNOWN`, the agent must rerun
  only the exact original tool and payload with the supplied idempotency key.
</Warning>
