Claude Code API Examples — Development skill for Claude Code
Runnable Python examples for claude code api: first request, streaming and tool use, key from the environment.
How to install Claude Code API Examples
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open normal-map-generator/claude-code-api-examples and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Code API Examples does
Runnable Python examples for claude code api: first request, streaming and tool use, key from the environment.
Alternatives in Development
- Breach Check — HIBP k-anonymity check on a password wordlist 4.5k ★
- 05 Env And Auth — Prompt 05: Environment Configuration & API Authentication 2.3k ★
- Spot — Place and manage spot trading orders on Binance via API key authentication, supporting mainnet and testnet 483 ★
README
Claude Code API examples
*Unofficial community examples for Claude Code and the Claude API. Not affiliated with Anthropic. All trademarks belong to their owners.*
Three short Python scripts for anyone who searched claude code api and wants to make a first request to the Claude API rather than read another overview. They follow the order the API course teaches: a basic request with a system prompt, then streaming, then a single tool-use round trip. The API key is read from the environment in every file. Model ids change over time, so each script takes the model from `CLAUDE_MODEL` and treats the default as illustrative; pick a current id from the API reference.
Want an app rather than an API client? [Try Begin.sh - prompt or URL in, static site or Expo app zip out](https://begin.sh?utm_source=github&utm_medium=ugc&utm_campaign=claude-code-api-examples&utm_content=readme-top&utm_term=tier-r).
Files
| Path | What it shows |
|---|---|
examples/quickstart.py |
One request with a system prompt; prints the text reply. |
examples/streaming.py |
The same request streamed token by token. |
examples/tool_use.py |
Defining one tool, handling the tool call, returning the result. |
Setup
pip install anthropic
export ANTHROPIC_API_KEY=your-key-from-the-console
export CLAUDE_MODEL=claude-sonnet-5 # illustrative; use a current id from the API reference
Create the key in the [Claude Console](https://platform.claude.com/). The [quickstart](https://platform.claude.com/docs/en/get-started) and [API reference](https://platform.claude.com/docs/en/api/overview) are the authority for parameter names and current models; the scripts use the minimal, long-stable shape (a model, a token limit, a system prompt and a list of messages).
examples/quickstart.py
Creates a client, sends a single user message with a short system prompt, and prints the text of the reply. This is the 'authentication, basic requests, system prompts' part of the course's first s
Related Skills
Claude Launchpad
A clear, beginner-friendly guide to the Claude developer ecosystem — Claude API, Claude Desktop, Claude Code,
Claude Sbox
Claude Code skill for s&box game development. Schema-verified API reference, 10 runnable examples, zero Unity
Setup Gemini
Configures the Gemini API key for image generation with Nano Banana. Use only on explicit user request.
Android Harness
Turn an Android phone into a full agent environment — Python, Node, Claude Code, Termux:API — provisioned in o
Alan Code Agent
Open-source Python implementation of a Claude-Code-like agent (Gemini CLI, Codex, Copilot...). Usable in CLI,
Meta Glasses Voice Bridge
Voice commands from Ray-Ban Meta smart glasses to your Mac, routed through Claude. iOS app built on the Meta W
Related Agents
Spgr Agent Backend Developer
Implements server-side features strictly within the confirmed API spec, ERD, ADRs, and tech stack, test-first,
Test Generator
Test specialist who analyzes code coverage gaps, generates unit/integration tests, and creates test fixtures.
Timps API Security Tester
Run an OWASP API Security Top-10 (2023) audit against an OpenAPI spec or live endpoint — broken auth, BOLA, ma