API Key
ELI5 — The Vibe Check
An API key is your password to use an AI service. You include it in every request to prove you're allowed to use the API and so they know who to charge. Guard it like your bank password — anyone who gets your API key can use it and you pay the bill. Never commit it to git. Never. Seriously.
Real Talk
An API key is a unique identifier token used to authenticate requests to an API. For LLM APIs (OpenAI, Anthropic, Google), keys are used to authenticate, authorize, and track usage for billing. They should be stored as environment variables or secrets, never hardcoded in source code or committed to version control.
Show Me The Code
import anthropic
import os
client = anthropic.Anthropic(
api_key=os.environ.get("ANTHROPIC_API_KEY") # never hardcode this
)
When You'll Hear This
"Add your API key to the .env file." / "Someone leaked the API key — rotate it immediately."
Related Terms
Chat Completion
Chat Completion is the API pattern for having a back-and-forth conversation with an AI.
LLM (Large Language Model)
An LLM is a humongous AI that read basically the entire internet and learned to predict what words come next, really really well.
Rate Limit
A rate limit is the AI provider saying 'slow down, buddy.
Streaming
Streaming is when the AI sends you its response word by word as it generates, instead of making you wait for the whole thing at once.