Everything you have done with AI in a chat window, a program can do through an API — the interface the same models expose to software. The chat product is one application built on that interface; your application can be the next one. This guide is the on-ramp: no framework, no jargon tour, just the four ideas that make every AI API make sense.

Idea one: it is a request with words in it

Strip away every SDK and an AI API call is a plain web request: you send a list of messages, you get a message back. The shape is so consistent across providers that learning one teaches you all of them — a system instruction that sets behavior, a conversation history, and the model's reply. Every AI product you have ever used is a loop around that exchange, plus interface. The mystique does not survive the first successful call, which is rather the point.

There is one habit shift from chat: the API remembers nothing. Each call stands alone, and 'conversation' exists only because your code sends the history back every time. Memory, personas, knowledge of your data — in an API world, those are all things your application constructs and sends. That sounds like a burden and is actually the power: you control exactly what the model sees.

Idea two: keys are credentials, and credentials leak

Access comes through an API key — a string that is, functionally, a password attached to a payment method. The rules are the same as for any credential, with one AI-specific sharpener: leaked keys get found and drained fast, because compute is money.

  • Keep keys in environment variables or a secrets manager, never in code — and never in a repository, public or private.
  • Use separate keys per project so one revocation does not break everything.
  • Set a spending limit before your first call, not after your first surprise. Every major provider's console supports this.

Idea three: you are billed in tokens

APIs price by the token — roughly three-quarters of an English word. You pay for what you send *and* what comes back, which has two practical consequences. First, sending an entire document when a page would do is not thoroughness; it is a tip. Second, conversation history you resend every call compounds — long-running chats get more expensive per message as they grow. Providers publish per-model token prices, and the spread between the largest and smallest models is wide enough that [choosing the right one](/build/choosing-models-costs/) is a real engineering decision, covered later in this track. The mechanics of tokens and context windows get a fuller treatment in [context windows and tokens](/guides/context-windows-and-tokens/).

Idea four: the subscription and the API are different products

A common early confusion: your chat subscription and API access are separate things with separate billing. The decision rule is about who initiates. A person at a keyboard doing their own work is the subscription's territory — flat price, no meter anxiety. Software acting on its own — processing a queue, powering a feature, serving your users — is the API's territory, priced per use. Most builders end up with both, and the [workplace track](/work/business-ai-plans/) covers how organizations sort this out at scale.

Your actual first project

Resist the chatbot. Everyone's first instinct is to build a chat interface, which teaches you mostly things you already knew. The move that teaches the API's real character is a transformer: a small script that takes something messy in and produces something structured out. Feed it your downloads folder's filenames and get organized names back. Feed it raw meeting notes and get action items. One call, no conversation state, obvious success criteria — and it exercises the skill that everything else in this track builds on: describing a transformation precisely enough that a model performs it reliably. That skill gets its own guide next: [prompting for programs](/build/prompting-for-programs/).

Provider documentation is uniformly good in this category, and current in a way no guide can be — start at Anthropic's, OpenAI's, or Google's docs, each of which gets you from key to first response in minutes.