Skills101
← All practice quizzes

Quiz: First API Call

5 questionsNo time limitPass: 60%+10 XP on first pass

Call an LLM from Python with the official Claude SDK: keeping API keys safe, the anatomy of a request and response, stop reasons, token usage, estimating cost in rupees, handling errors and retries — and how to practise for free with a local stand-in API.

Log in to take the quiz

Free account · see your score, answers and explanations, earn XP

  1. Question 1

    Where should your API key live?

  2. Question 2

    stop_reason is "max_tokens". What happened?

  3. Question 3

    What is the system prompt for?

  4. Question 4

    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. Question 5

    Which error should usually be retried after waiting?