# Authentication

> How to authenticate requests to the GeoInfer API using API keys.

Source: https://docs.geoinfer.com/authentication

The GeoInfer API uses API keys for authentication. All authenticated endpoints require the following request header:

```
X-GeoInfer-Key: geo_your_api_key_here
```

API keys always start with `geo_`.

## Create an API key

1. Sign in at [geoinfer.com](https://geoinfer.com)
2. Go to [app.geoinfer.com/en/api](https://app.geoinfer.com/en/api)
3. Click **New Key**, give it a name, and copy it immediately. It is only shown once

## Using your key

Pass the key in the `X-GeoInfer-Key` header on every authenticated request:

```bash
curl -H "X-GeoInfer-Key: geo_your_api_key_here" https://api.geoinfer.com/v1/credits/summary
```

## Key security

- Store keys in environment variables, never in source code
- Rotate keys immediately if compromised. Use the **Regenerate** button on the API page
- Each key is scoped to your account and inherits your plan's credit balance and rate limits

## Unauthenticated endpoints

`GET /v1/prediction/models` does not require authentication. All other endpoints do.

## Error responses

| HTTP Status             | Meaning                          |
| ----------------------- | -------------------------------- |
| `401 Unauthorized`      | Key is missing or invalid        |
| `402 Payment Required`  | Account has no remaining credits |
| `429 Too Many Requests` | Rate limit exceeded              |