normal-map-generator

Claude Code API Examples — Development skill for Claude Code

Development community

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