# AI Agent: API Key Guides

Getting API access to a large language model involves more than creating an account. Because each provider uses a different console, billing system, credential format, and security policy, the process varies. This document provides the steps to get, configure, and test API keys for five major AI platforms, which helps you avoid common issues when you start building.

### Before you begin&#x20;

Each provider requires a verified account and a payment method. You must have a credit or debit card ready. Because most platforms display your API key only once, you must store it securely.

### What's Inside

<table><thead><tr><th width="112.5999755859375">Serial No.</th><th width="170.59991455078125">Provider</th><th width="249">Auth Method</th><th width="113.4000244140625">Free Tier</th></tr></thead><tbody><tr><td>1</td><td>OpenAI</td><td>API Key</td><td>No</td></tr><tr><td>2</td><td>Anthropic (Claude)</td><td>API Key</td><td>No</td></tr><tr><td>3</td><td>Google Gemini</td><td>API Key</td><td>Yes</td></tr></tbody></table>

### &#x20;Key differences at a glance

<table><thead><tr><th width="165.79998779296875">Provider</th><th>Credential format</th><th>Billing and access notes</th></tr></thead><tbody><tr><td>OpenAI</td><td>Standard API key</td><td>Requires a minimum $5 credit purchase to process requests. The key is displayed only once.</td></tr><tr><td>Anthropic Claude</td><td>API key (uses the <code>x-api-key</code> header instead of a <code>Bearer</code> token)</td><td>Uses a prepaid credit model. Account approval might be required depending on your region.</td></tr><tr><td>Google Gemini</td><td>Standard API key</td><td>Offers a free tier. You can view your key multiple times in AI Studio. For production workloads, use Vertex AI.</td></tr></tbody></table>

### Universal security rules

{% hint style="warning" %}
These rules apply to every provider in this document.
{% endhint %}

* Do not commit your API keys to a public repository.
* Store your keys in environment variables or a secure secrets manager. Do not store them in plain text files.
* Set spending limits, if the provider supports them, to prevent unexpected charges.
* Rotate your keys periodically. If you suspect a leak, rotate them immediately.
* Grant the minimum required permissions for each key.

### Useful Links

* OpenAI API Documentation: [platform.openai.com/docs](http://platform.openai.com/docs)
* OpenAI API Keys Dashboard: [platform.openai.com/api-keys](http://platform.openai.com/api-keys)
* Anthropic Console: [console.anthropic.com](http://console.anthropic.com)
* Anthropic API Documentation: [docs.anthropic.com](http://docs.anthropic.com)
* Google AI Studio: [aistudio.google.com](http://aistudio.google.com)
* Gemini API Documentation: [ai.google.dev/gemini-api/docs](https://ai.google.dev/gemini-api/docs)
