ClaudeApi Component
The<ClaudeApi> component provides an alternative way to execute Claude using the Anthropic SDK directly, rather than through the Claude Code CLI.
This component is for scenarios where you need direct API access. For most use cases, the standard
<Claude> component is recommended as it provides full tool access and better integration with Smithers features.Usage
Props
The Anthropic model ID to use (e.g., “claude-sonnet-4”, “claude-opus-4”).
Maximum number of conversation turns.
Tool names to make available.
System prompt to use.
Callback when execution completes. See ClaudeApiResult for the result shape.
Callback when an error occurs.
The prompt to send to Claude.
ClaudeApiResult
TheonFinished callback receives a result object with the following shape:
AgentResult type exported from smithers-orchestrator.
When to Use ClaudeApi vs Claude
| Feature | Claude | ClaudeApi |
|---|---|---|
| Tool access | Full CLI tools | Custom tools only |
| File editing | Built-in | Manual |
| Database logging | Automatic | Manual |
| MCP support | Yes | No |
| Structured output | Yes | Manual |
| Best for | Agentic tasks | Simple completions |
Use Claude for:
- File editing and code modifications
- Multi-turn agentic workflows
- Tasks requiring CLI tools (Bash, Read, Write, etc.)
- Workflows that need database logging
Use ClaudeApi for:
- Simple text generation
- Custom API integrations
- Direct control over the Anthropic SDK
- Non-agentic tasks