Flock supports Anthropic’s Claude family of models through a dedicated provider. Claude models are available for text completion, filtering, and aggregation. Note that Anthropic does not provide an embeddings API — if you need embeddings for RAG pipelines or similarity search, use the OpenAI or Ollama provider alongside Claude.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dais-polymtl/flock/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
You need an Anthropic API key. Create one at console.anthropic.com. Make sure Flock is installed and loaded before continuing — see the Quickstart if you haven’t done that yet.Configure your secret
Store your API key usingCREATE SECRET with the anthropic type. You can optionally specify an API version — Flock defaults to 2023-06-01:
API_KEY field is required. API_VERSION is optional — the default 2023-06-01 works with all current Claude models.
Create a model
Register a named model using a Claude model ID and theanthropic provider. Anthropic requires a max_tokens parameter — Flock defaults to 4096 if you omit it.
| Argument | Description |
|---|---|
'ClaudeModel' | Unique name you reference in queries |
'claude-sonnet-4-5' | Anthropic model ID |
'anthropic' | Provider name |
{...} | Config: batch size, tuple format, and model parameters |
Run a query
With your secret and model in place, callllm_complete:
Available Claude models
Flock works with all current Claude models. The adapter automatically selects the correct API method based on the model version.| Model ID | Description | Structured output method |
|---|---|---|
claude-opus-4-5 | Most capable | output_format |
claude-sonnet-4-5 | Best balance of speed and capability | output_format |
claude-haiku-4-5 | Fast and cost-effective | output_format |
claude-3-5-sonnet-20241022 | Previous Sonnet generation | tool_use |
claude-3-haiku-20240307 | Previous Haiku generation | tool_use |
Structured output
Flock uses a hybrid approach for structured JSON output depending on the Claude model generation:- Claude 4.x models use the native
output_formatAPI, which guarantees strict schema compliance - Claude 3.x models fall back to
tool_use, which provides structured output on models that predate theoutput_formatAPI
Custom schemas must include
"additionalProperties": false on all objects — this is required by the Anthropic output_format API.Model parameters
You can customize Claude’s behavior with additional parameters in the model config:| Parameter | Description |
|---|---|
temperature | Controls randomness, 0.0 to 1.0 |
max_tokens | Maximum response length (required by Anthropic, default: 4096) |
system | System prompt for context and instructions |
top_p | Nucleus sampling threshold |
top_k | Limits token selection to top K options |
Next steps
Structured output
Full guide to enforcing JSON schemas on LLM responses
Scalar functions
Reference for llm_complete, llm_filter, and aggregate functions