🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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 →
  1. Q1. Where should your API key live?
  2. Q2. stopreason is "maxtokens". What happened?
  3. Q3. What is the system prompt for?
  4. 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?
  5. Q5. Which error should usually be retried after waiting?
  6. Q6. Why must API calls go through your server and not straight from a website or mobile app?
  7. Q7. What does this print? (code)
  8. Q8. Why should you check block.type before reading text from response.content?
  9. Q9. A request fails with a 400 Bad Request error. What is the right response?
  10. Q10. What does the local stand-in API in this lesson let you do?