> For the complete documentation index, see [llms.txt](https://titan-exchange.gitbook.io/titan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://titan-exchange.gitbook.io/titan/developer-doc/developers-portal/authentication.md).

# Authentication

Authenticate Portal requests with an API key.

Every request to `portal.api.titan.exchange` carries an API key in the `x-api-key` header. Create one at [developer.titan.exchange](https://developer.titan.exchange/).

```
x-api-key: <your key>
```

No wallet signature is required to fetch quotes. Signing applies only when you submit the resulting transaction to Solana through your own RPC.

## Verifying a key

`/api/v1/info` takes no parameters and returns the protocol version. Use it to confirm a key is valid before making quote requests.

{% tabs %}
{% tab title="curl" %}

```bash
curl "https://portal.api.titan.exchange/api/v1/info" \
  -H "x-api-key: $TITAN_API_KEY" \
  -H "Accept: application/json"
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
const res = await fetch('https://portal.api.titan.exchange/api/v1/info', {
  headers: {
    'x-api-key': process.env.TITAN_API_KEY!,
    Accept: 'application/json',
  },
});
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
```

{% endtab %}

{% tab title="Python" %}

```python
import os, requests

res = requests.get(
    'https://portal.api.titan.exchange/api/v1/info',
    headers={
        'x-api-key': os.environ['TITAN_API_KEY'],
        'Accept': 'application/json',
    },
)
res.raise_for_status()
```

{% endtab %}
{% endtabs %}

A missing, unknown or revoked key returns `401`:

```json
{ "error": { "code": "invalid_api_key" } }
```

{% hint style="warning" %}
A distributor JWT sent to `portal.api.titan.exchange` returns the same `401 invalid_api_key`, as does a Portal key sent to a distributor endpoint. Confirm the hostname before rotating a key that has stopped working.
{% endhint %}

## Key handling

Keys identify your organization. Every request made with one counts against your plan's rate limit and credit balance.

Keys must stay server-side. Browser and mobile clients should call your own backend, which holds the key and forwards the request. The [middleware example](https://github.com/Titan-Pathfinder/titan-sdk-ts/blob/main/examples/middleware.ts) in the TypeScript SDK repository demonstrates the proxy pattern.

Paid plans include five keys. Rate limits and credits are pooled across every key in the organization, so issuing one key per service or environment does not reduce throughput and allows rotation without downtime. See [Plans, Rate Limits & Credits](/titan/developer-doc/developers-portal/plans-rate-limits-credits.md).

## Distributor access

Titan is also available through [Triton](https://docs.triton.one/trading-apis/titan-swap-api) and [QuickNode](https://marketplace.quicknode.com/add-on/titan-swap), which issue a JWT and a provider-specific endpoint. That path is documented under [Authentication](/titan/developer-doc/getting-started/authentication.md) in Getting Started.
