> ## Documentation Index
> Fetch the complete documentation index at: https://pioneer-kelton-add-decoder-inference-prices.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Pioneer API key management: create, list, and revoke

> Manage Pioneer API keys: create keys in the dashboard, list active keys, and revoke keys programmatically. The secret_key is returned only at creation.

Every request to the Pioneer API requires an API key passed in the `X-API-Key` header. Create keys in the Pioneer dashboard, then use the key management endpoints to list and revoke existing keys programmatically.

<Tip>
  Store API keys in environment variables rather than hardcoding them in source code. For example, set `PIONEER_API_KEY` in your environment and read it at runtime. Never commit API keys to version control.
</Tip>

***

## Create an API key

`POST /create-api-key`

Generates a new API key associated with your account. This endpoint is used by the Pioneer dashboard and requires a browser session. Calls authenticated with an existing API key are rejected with `403 Forbidden` to prevent credential chaining.

**Request body**

<ParamField body="name" type="string" required>
  A descriptive name to identify this key. Use names that reflect the key's purpose or the service it belongs to, for example `"ci-pipeline"` or `"production-inference"`.
</ParamField>

<Warning>
  Do not use an existing API key to create another API key. `X-API-Key` authentication is not accepted for this endpoint; create keys from **Settings** -> **API Keys** in the dashboard.
</Warning>

**Response**

<ResponseField name="secret_key" type="string">
  The full API key value. This is the only time it is returned in plaintext — copy it immediately and store it somewhere secure such as a secrets manager or environment variable.
</ResponseField>

<ResponseField name="id" type="string">
  Unique identifier for the key. Use this ID when revoking the key.
</ResponseField>

<ResponseField name="name" type="string">
  The name you assigned to the key.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of when the key was created.
</ResponseField>

<ResponseField name="api_key_last_digits" type="string">
  Last digits of the generated key for display and identification.
</ResponseField>

<ResponseField name="expires_at" type="string | null">
  Optional ISO 8601 expiration timestamp, or `null` when the key does not expire.
</ResponseField>

<ResponseField name="team_id" type="string">
  Team the key is bound to.
</ResponseField>

<ResponseField name="stripe_customer_created" type="boolean">
  Whether Pioneer created a Stripe customer record during key creation.
</ResponseField>

<Warning>
  The full key value is only returned at creation time. If you lose it, you must revoke the key and create a new one.
</Warning>

***

## List API keys

`GET /list-api-keys`

Returns all API keys associated with your account. Key values are masked in the response — only metadata such as name and creation date are returned.

```bash theme={null}
curl https://api.pioneer.ai/list-api-keys \
  -H "X-API-Key: YOUR_API_KEY"
```

**Response**

<ResponseField name="keys" type="object[]">
  Array of API key metadata objects.

  <Expandable title="key properties">
    <ResponseField name="id" type="string">
      Unique identifier for the key. Use this ID when revoking the key.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name assigned to this key.
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 creation timestamp.
    </ResponseField>

    <ResponseField name="api_key_last_digits" type="string">
      Last digits of the key for display and identification.
    </ResponseField>

    <ResponseField name="last_used_at" type="string | null">
      ISO 8601 timestamp of the most recent request made with this key, if available.
    </ResponseField>

    <ResponseField name="expires_at" type="string | null">
      Expiration timestamp, or `null` when the key does not expire.
    </ResponseField>

    <ResponseField name="team_id" type="string | null">
      Team the key is bound to.
    </ResponseField>

    <ResponseField name="usage_tokens" type="number">
      Total tokens used by this key.
    </ResponseField>

    <ResponseField name="usage_cost" type="number">
      Total cost attributed to this key.
    </ResponseField>

    <ResponseField name="request_count" type="number">
      Number of requests made with this key.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="count" type="number">
  Number of keys returned.
</ResponseField>

***

## Revoke an API key

`DELETE /delete-api-key`

Permanently revokes an API key. Any requests using the revoked key will immediately receive `401 Unauthorized` responses.

**Request body**

<ParamField body="key_id" type="string" required>
  The unique ID of the key to revoke, as returned by `GET /list-api-keys`.
</ParamField>

```bash theme={null}
curl -X DELETE https://api.pioneer.ai/delete-api-key \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"key_id": "YOUR_KEY_ID"}'
```

<Warning>
  Revoking a key is immediate and irreversible. Ensure any services using the key are updated to use a replacement key before revoking the old one to avoid service interruptions.
</Warning>

**Response**

Returns `200 OK` with a JSON success body.

<ResponseField name="success" type="boolean">
  Whether the key was revoked.
</ResponseField>

<ResponseField name="message" type="string | null">
  Human-readable status message.
</ResponseField>
