A useful but little-known Claude API feature
🔌 Want to use Agent Skills not just in Claude Code or Console, but directly from your API? Now you can.
Skills in the API shows how to invoke Agent Skills via the Messages API. Bring the power of skills into your own applications and supercharge API-based agents.
📌 Title: Skills in the API
🔗 URL:
🧩 Overview
Agent Skills were originally a Claude Code and Console feature, but Skills in the API lets you call them directly from the Messages API. Apply the workflows, tools, and knowledge defined in skills to your API-based agents, deploying skills prototyped in the Console straight to production.
🛠 How to use it
Specify skills in `container.skills` on your Messages API request (each entry takes `type` of `anthropic` or `custom`, a `skill_id`, and an optional `version`; up to 20 skills per request). You also need the code execution tool (`code_execution_20250825`) in `tools`, and then the API response reflects agent behavior guided by that skill. The key benefit: skills prototyped in the Console work in the production API without code changes.
🏗 Building it into production
・Production agents: deploy skills developed and tested in the Console directly to your API. Smooth transition from prototype to production.
・Microservice integration: have each microservice call the skills it needs via API. Easy skill sharing and reuse across services.
・Dynamic skill selection: build a router that calls different skills dynamically based on user request content.
・A/B testing: switch between skill versions via API to automate quality comparison evaluations.
💡 Use cases
🚀 Console-to-API skill deployment
🔗 Skill reuse across microservices
🔀 Dynamic skill selection routing
🧪 Skill A/B testing
⚠️ Watch out
Skill quality determines result quality whether you're in the Console or the API. Test thoroughly in the Console before deploying to API. Also, skill updates may immediately affect API behavior, so pay attention to version management.
✨ Skills built in the Console work directly in the API. Use this shortest path from prototype to production.
#
Claude# #
LLM#