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

# Headless configuration

> Configure a licensed gateway from local files and verify a model request.

Use headless mode when the gateway must load configuration from local files instead of synchronizing with Edgee. It still needs a valid license and network access to the configured model providers. A fully isolated deployment needs reachable provider endpoints inside that environment.

## Required inputs

| Input                  | Purpose                                                                                     |
| ---------------------- | ------------------------------------------------------------------------------------------- |
| `LICENSE_KEY`          | Authorizes the licensed deployment                                                          |
| `EDGEE_API_SYNC=false` | Turns off Edgee configuration synchronization                                               |
| `CONFIG_FILE`          | Path to your `gateway.toml`                                                                 |
| `PROVIDER_KEYS_FILE`   | Optional path to provider credentials; without it, no system-level provider keys are loaded |
| Gateway bearer token   | Authenticates the calling client; must correspond to a configured key                       |

Use the deployment credentials and configuration supplied for your licensed organization. A made-up bearer string does not become a valid Gateway token by adding it to TOML.

## Gateway file structure

This is an **illustration of the structure**, not a ready-to-run configuration. Replace the key lookup value, identifiers, models, and pricing with those for your deployment. The API-key table name corresponds to the token's `k` claim, not the entire bearer token.

```toml theme={"dark"}
[api_keys."<key-lookup-value>"]
id = "<key-id>"
organization_id = "<organization-id>"
models = ["openai/gpt-4o"]
max_usage = -1
active = true
expires_at = 9999999999

["models"."model:openai/gpt-4o".providers.openai]
input_token_cost = 2500
output_token_cost = 10000
context_max_size = 128000
```

Costs are **nanodollars per token**: 1 USD is 1,000,000,000 nanodollars. The sample cost fields illustrate units, not current provider pricing. `expires_at` uses Unix seconds; choose your intended expiry.

<Warning>
  Headless mode does not synchronize usage from Edgee. Without that usage data, usage-based limit checks fail open. Do not use the sample `max_usage` field as proof of an enforced spending cap. Connected mode supplies current usage through synchronization.
</Warning>

## Provider credentials

The provider credential file is flat TOML, without a section header:

```toml theme={"dark"}
openai = "<provider-api-key>"
anthropic = "<provider-api-key>"
```

Mount it read-only and set `PROVIDER_KEYS_FILE` to its container path. In connected mode this file is ignored; credentials come from configuration sync instead. Keep both deployment and provider credentials out of version control.

## Verify a real request

A successful `/status` health response only proves the server is running. Test authentication, model configuration, and provider access too:

```bash theme={"dark"}
# Set EDGEE_API_KEY to a valid Gateway token for this deployment.
curl http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer $EDGEE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"openai/gpt-4o","messages":[{"role":"user","content":"Reply with OK"}]}'
```

Expect a successful model response. For an authentication error, check the token and configured key. For a provider error, check provider credentials and connectivity. Inspect gateway logs without printing secrets.

To point an agent at this deployment, follow [CLI gateway configuration](/docs/cli/configuration). For connected mode, confirm the request also appears in the expected organization's usage records.
