Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Locked learning resources

This lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

APIs and Other Models

When an app builder asks you for an API key, or someone says a tool “uses another model,” they’re talking about what happens behind the scenes when a program uses a model. That’s true of all three ways to use a model from Request, Chat, and Agent, and some tools and skills bring a second model into the job.

APIs and API Keys

An API is how one program asks another service for something. When an app sends a request to the company that runs the model and gets an answer back, developers say the app “calls the API.” Every message you send in a chat app reaches the model this way. The chat app uses the company’s own access, so you never see a key.

An API key is like a pass that proves a program is allowed to use a service. It also ties every request to an account, and requests made with a key are usually charged by use, which works differently from a chat subscription. That’s the pay-per-use side of Usage, Limits, and Tokens. App builders ask for keys when your app needs a service of its own, like a model, email, or payments.

Treat a key like a password. Paste it only into the settings box the app builder made for keys. In an ordinary chat message, it becomes part of the conversation, and the whole conversation gets sent to the model.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Already a member? Sign-In

00:00 APIs and Other Models.

00:03 Sometimes an app builder asks you for an API key. Or someone says a tool uses another model. Both are about what happens behind the scenes when a program uses a model.

00:14 That’s true of all three ways to use a model, from the lesson on requests, chats, and agents. And some tools and skills bring a second model into the job.

00:24 An API is how one program asks another service for something. An app sends a request to the company that runs the model, and it gets an answer back. Developers say the app calls the API when it does this.

00:36 Every message you send in a chat app reaches the model this way. The chat app uses the company’s own access, so you never see a key. An API key is like a pass.

00:47 It proves that a program is allowed to use a service. It also ties every request to an account. Requests made with a key are usually charged by use, which works differently from a chat subscription.

00:59 App builders ask for a key when your app needs a service of its own. That might be a model, or a service for email or payments.

01:07 Treat a key like a password. Paste it only into the settings box that the app builder made for keys. If you paste it into an ordinary chat message, it becomes part of the conversation.

01:17 And the whole conversation gets sent to the model.

01:21 Some tools and skills hand one step of a job to a different model. A model that only reads text and images can’t watch a video, for example. So an app that summarizes your recorded meetings might send each recording to a model that can watch video, like Gemini, and then work from the notes it sends back.

01:39 That handoff is usually a single request. One recording goes in, and one set of notes comes out.

01:47 Each model in a handoff sees only what it’s given. The video model gets one recording and the instructions for it. It never sees your conversation. The model you’re chatting with never watches the recording.

02:00 It only reads the notes. So when the result misses something, ask which model saw what.

02:07 So an API is how a program asks a service for something, and a key is the pass that lets it. Keep keys out of your chat messages. And when one step goes to another model, ask which model saw what.

02:19 You’ll use that question again in the next lesson, as one of four questions for a wrong result. Below this video, you can ask the mentor to quiz you on handoffs, one situation at a time.

Become a Member to join the conversation.