---
title: "How to Get an AI API Key: A Guide by Provider"
url: https://www.devjpt.com/en/blog/how-to-get-an-ai-api-key/
site: "Jean-Philippe Thériault"
type: post
language: en
published: 2026-11-06T01:10:31+00:00
updated: 2026-11-29T04:19:49+00:00
author: "Jean-Philippe Thériault"
description: "Learn how to get an AI API key from OpenAI, Anthropic, Google, Mistral, Cohere and others, then add it securely to ChatJPT."
translations:
  ca: https://www.devjpt.com/ca/blog/obtenir-una-clau-api-ia/
  es: https://www.devjpt.com/es/blog/obtener-una-clave-api-ia/
  fr: https://www.devjpt.com/blog/obtenir-une-cle-api-ia/
agent:
  instructions: "This site offers a search endpoint for AI agents. Results are returned in Markdown."
  endpoint: "https://www.devjpt.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://www.devjpt.com/.well-known/agent-skills/lire-devjpt/SKILL.md"
---

# How to Get an AI API Key: A Guide by Provider

To chat with an AI model through a tool such as [ChatJPT](https://www.devjpt.com/en/chatjpt-en/), you first need to **get an API key**. Think of it as a password that connects your requests to your account with an AI provider. The good news is that it takes only a few minutes. This article is part of the [guide to using ChatJPT](https://www.devjpt.com/en/blog/how-to-use-chatjpt/).

## What Is an API Key?

An API key is a long sequence of characters, often beginning with a prefix such as `sk-`. It allows software to call a provider’s AI models on your behalf. Requests are therefore billed to your account based on usage: you pay for what you consume.

Important: treat an API key like a password. Anyone who gets hold of it may be able to use your credits.

## The Steps Are Usually the Same

With most providers, getting an API key follows a similar process:

1. Create an account on the provider’s developer console.
2. Add a payment method or credits if required.
3. Open the **API Keys** section.
4. Click **Create API key**, name the key, and copy it.

Copy it immediately: many providers display the full key only once.

## Where to Get an API Key, Provider by Provider

### United States

- **OpenAI** (GPT, images, voice): [platform.openai.com](https://platform.openai.com/)
- **Anthropic** (Claude): console.anthropic.com
- **Google** (Gemini, Gemma): aistudio.google.com
- **xAI** (Grok): console.x.ai
- **Perplexity:** console.perplexity.ai
- **Meta** (Muse): dev.meta.ai

### Canada, France, and Other Countries

- **Augure** (Montreal) and **Cohere** (Toronto): Cohere offers a free trial key limited to 1,000 calls per month.
- **Mistral AI** (France): console.mistral.ai. The free tier has very low limits; enable pay-as-you-go for regular use.
- **Recraft** (United Kingdom) and **Bria** (Israel): image generation only.
- **Upstage** (South Korea): console.upstage.ai, with $10 in free credits.

### China

- **DeepSeek**, **Kimi** (Moonshot AI), and **MiniMax:** Each has its own international platform.
- **Alibaba** (Qwen): One key per region. The region you choose when creating the key matters; for example, video is available only with a United States or Hong Kong key.

The `API_KEYS_GUIDE.txt` file supplied with ChatJPT lists these addresses in French, English, and Spanish.

## Add Your Key to ChatJPT

Once you’ve copied the key, open ChatJPT and click the key panel at the top left. Find the provider under its country and paste the key into its field. The provider’s badge then changes to ✓.

The key is encrypted in your browser’s storage and sent only to the matching provider. On a shared computer, the erase button removes all saved keys at once.

## How Much Does It Cost?

Pricing depends on the model and usage volume. An ordinary conversation typically costs a fraction of a cent. Models that reason for longer, image generation, and especially video generally cost more.

To stay in control, ChatJPT displays the tokens used for each response and a total for the conversation. Most developer consoles also let you set a monthly spending limit; that is a sensible step from the start.

## Common Problems

- **“Invalid key”:** Make sure you did not copy an extra space with the key.
- **“Rate limit reached”:** Your free tier may be exhausted, or you may be sending too many requests per minute.
- **“Insufficient credit”:** Add credits through the provider’s console.

In every case, ChatJPT displays the provider’s exact error message in parentheses, which makes it easier to identify the problem.

## What’s Next?

With one key, you’re ready to go. A particularly useful first experiment is to get keys from two providers and [compare two AI models](https://www.devjpt.com/en/blog/compare-two-ai-models/) using the same question.
