Anthropic Provider Setup
To use the Anthropic provider, you need to get your API key from the Anthropic Console. Only two steps are required:- First, create a secret with your Anthropic API key. Optionally, you can specify an API version (defaults to
2023-06-01):
- Next, create your Claude model in the model manager. Make sure that the name of the model is unique:
- Now you can use Flock with the Anthropic provider:
Available Claude Models
Anthropic offers several Claude models with different capabilities and price points. See the Anthropic Models Documentation for the full list.
All models are fully supported. The adapter automatically selects the appropriate API method based on model version.
Model Parameters
You can customize Claude’s behavior with model parameters:Supported Parameters
Flock supports all parameters provided by the Anthropic Messages API. Common examples include:temperature- Controls randomness (0.0 to 1.0)max_tokens- Maximum response length (required by Anthropic, default: 4096)system- System prompt for context and instructionstop_p- Nucleus sampling thresholdtop_k- Limits token selection to top K options
System Prompts
Unlike other providers, Anthropic handles system prompts separately from the message history. You can set a system prompt in the model parameters:Image Support
Claude models support image analysis. Images can be provided as:- URLs –
http://orhttps://URLs are downloaded and converted to base64 automatically - File paths – Local files are read and converted to base64
- Base64-encoded data – Used directly
Structured Output
Flock ensures structured JSON responses from all Claude models using a hybrid approach:- Claude 4.x models: Uses the native
output_formatAPI (preferred, guaranteed schema compliance) - Claude 3.x models: Falls back to
tool_usefor structured output (compatible with older models)
Custom Schema (Claude 4.x only)
For Claude 4.x models, you can specify a custom JSON schema:"additionalProperties": false for all objects.
Important: No Embedding Support
Anthropic does not provide an embeddings API. If you need embeddings for similarity search or RAG pipelines, use OpenAI or Ollama instead:llm_embedding with an Anthropic model will result in a clear error message.
Rate Limits and Usage
Anthropic has rate limits based on your plan tier. Monitor your usage in the Anthropic Console. For high-volume workloads, use appropriatemax_batch_size settings and consider setting a per-model rate_limit in Flock to throttle requests per minute (see Models Management).
API Version
The default API version is2023-06-01. You can override this when creating a secret by passing the optional API_VERSION parameter. The adapter automatically includes the required anthropic-version header with all requests.
