← All topics
Quiz: First API Call: questions with answers
10 questions, each with the answer and a short explanation.
Take the timed quiz + get a certificate →- Q1. Where should your API key live?
- Q2. stopreason is "maxtokens". What happened?
- Q3. What is the system prompt for?
- Q4. A request uses 2,000 input and 300 output tokens on a model priced $4 / $20 per million. What does it cost in dollars?
- Q5. Which error should usually be retried after waiting?
- Q6. Why must API calls go through your server and not straight from a website or mobile app?
- Q7. What does this print? (code)
- Q8. Why should you check block.type before reading text from response.content?
- Q9. A request fails with a 400 Bad Request error. What is the right response?
- Q10. What does the local stand-in API in this lesson let you do?