claude-api-reference

Reference Claude API patterns for Python messaging, vision, PDF, and streaming workflows.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/laitim2001/ai-semantic-kernel-framework-project --skill claude-api-reference
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-api-reference
Source: https://github.com/laitim2001/ai-semantic-kernel-framework-project/tree/main/.claude/skills/claude-api-reference
Command: npx skills add https://github.com/laitim2001/ai-semantic-kernel-framework-project --skill claude-api-reference

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires anthropic, and includes scripts (resource) and references (resource) components.

What problem does it solve?

Provide a practical, developer-focused reference that accelerates building Claude API integrations for messaging, vision, PDF processing, tool use, streaming, and batch workflows while reducing errors and integration time.

Core Features & Use Cases

  • API patterns & headers: Clear guidance for constructing requests, required headers, and model selection strategies.
  • File and image handling: Best practices for base64 uploads, Files API usage, size and page limits, and mixed-media messages.
  • Streaming, batching & tool use: Examples for streaming responses, async handling, batch jobs for cost savings, and function-calling/tool integrations with retry and error strategies.
  • Developer examples: Ready-to-run Python scripts for interactive chat, PDF analysis, and streaming handlers to bootstrap real-world integrations.

Quick Start

Use the claude-api-reference to implement a Python endpoint that uploads a PDF, encodes it to base64, calls Claude messages.create with a document message, and returns a concise summary.

Frequently Asked Questions about claude-api-reference

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use the Claude API for PDF processing and file uploads?

To process PDFs with the Claude API, you upload the file, encode it to base64, and pass it in a document message to the messages endpoint. This Skill provides Python examples for base64 uploads, Files API usage, and handling mixed-media messages.

What is the best way to implement streaming responses with the Anthropic Python SDK?

Implementing streaming responses with the Anthropic Python SDK involves using specific streaming patterns and handlers to process data chunks incrementally. This Skill offers ready-to-run Python scripts for building streaming handlers to manage real-time message generation.

Can I use the Claude API for batch processing to reduce costs?

Yes, you can use the Claude API for batch processing to achieve cost savings on large workloads. This Skill includes guidance and examples for configuring batch jobs and asynchronous handling within your Python integrations.

Does the Anthropic Python SDK support tool use and function calling?

Yes, the Anthropic Python SDK supports tool use and function-calling workflows to extend model capabilities. This Skill provides patterns for integrating external tools, managing function calls, and implementing error handling with retry strategies.

How do I handle image processing and size limits when sending requests to Claude?

Handling image processing with Claude requires adhering to specific base64 encoding practices and image size limits within your API requests. This reference outlines best practices for file and image handling, including size and page constraints.

What are the required headers and model selection strategies for Claude API messaging?

Required headers and model selection strategies for Claude API messaging are essential for constructing valid requests and optimizing performance. This Skill provides clear guidance on setting request headers and choosing appropriate models for your application.