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

# API Keys

> Manage programmatic access to the Traceport Gateway.

**API Keys** give your applications programmatic access to the Traceport Gateway. By replacing your direct provider keys with a Traceport Key, all traffic routes through Traceport for observability, routing, and cost tracking.

Navigate to **API Keys** under API Management in the sidebar.

<Frame>
  <video autoPlay loop muted playsInline src="https://mintcdn.com/traceport/ZXBNThc7kv_3RvjA/images/api-keys.mp4?fit=max&auto=format&n=ZXBNThc7kv_3RvjA&q=85&s=64ea66ca9dd160fa5aecdc055cc62e3e" className="w-full rounded-lg" data-path="images/api-keys.mp4" />
</Frame>

## Generating Keys

<Steps>
  <Step title="Create New Key">
    Click **Create New Key** on the API Keys page.
  </Step>

  <Step title="Name Your Key">
    Provide a descriptive name (e.g., "Production API", "Staging", "Dev Testing") to identify its purpose.
  </Step>

  <Step title="Copy and Store">
    Copy the generated key and store it securely.
  </Step>
</Steps>

<Warning>
  API keys are only displayed **once** at creation time. Copy and store them securely before closing the dialog.
</Warning>

## Using Your API Key

Use your Traceport API Key as a drop-in replacement for your provider keys:

<CodeGroup>
  ```python Python theme={null}
  from openai import OpenAI

  client = OpenAI(
      api_key="<YOUR_TRACEPORT_API_KEY>",
      base_url="https://api.traceport.ai/v1"
  )
  ```

  ```javascript Node.js theme={null}
  import OpenAI from "openai";

  const client = new OpenAI({
    apiKey: "<YOUR_TRACEPORT_API_KEY>",
    baseURL: "https://api.traceport.ai/v1"
  });
  ```
</CodeGroup>

## Security and Revocation

If an API key is compromised or no longer needed:

1. Find the key in the list and click the `...` menu.
2. Choose **Revoke** to immediately disable it.

<Note>
  Revoking a key is **irreversible**. Any applications using the revoked key will immediately lose access to the gateway.
</Note>
