AI service
Anthropic
The Anthropic integration connects your project to the Anthropic (Claude) API — with a shared, Dreambase-managed key or a dedicated key you provide — exposes the connection details as outputs, and offers messages, token counting, and model listing via function calls, plus health checks and metrics.
Anthropic is one of the AI service integrations. It handles its own webhook route:
/anthropic/webhookWhat it does
On DEPLOYMENT_CREATED the service resolves the key (shared or dedicated), verifies it against the Anthropic /v1/models endpoint, and publishes the connection details — apiKey, models, and apiUrl — back to Dreambase as outputs for other services to consume. The deployment connects to the provider API; there is no infrastructure to provision.
Instance type
- shared (default) — use the Dreambase-managed Anthropic key (
ANTHROPIC_SHARED_API_KEY). Ideal for MVPs and development, with no setup required. - dedicated — bring your own Anthropic API key.
Choosing models
Themodels input is a comma-separated list of the model IDs you want to work with (e.g. claude-opus-4-8, claude-sonnet-5, claude-haiku-4-5). The first one is used as the default when a function call doesn't name a model. Configured models that the key can't see are logged as a warning at configure time, but don't fail the connection.Inputs
| Input | Applies to | Description |
|---|---|---|
serverType | all | Either shared (default) or dedicated. |
apiKey | dedicated | Your Anthropic API key. Accepts a {{env.KEY}} reference. |
baseUrl | all | Optional. Target an Anthropic-compatible gateway (default https://api.anthropic.com). |
models | all | Comma-separated model IDs to work with. The first is the default. |
Outputs
apiKey— the resolved Anthropic API key.models— the comma-separated list of configured model IDs.apiUrl— the base URL used for API requests.
Functions
Callable via a FUNCTION_CALL event:
listModels— list the model IDs available to the key.createMessage— generate a message. Provide either a fullmessagesarray or a simpleprompt(with an optionalsystemprompt), plus optionalmodel,maxTokens(default1024), andtemperature. Returns the concatenated textcontent,model,stopReason, andusage.countTokens— count the input tokens a message would use, without generating a response. ReturnsinputTokens.
Metrics
On METRIC_UPDATE the service reports available_models (the number of models the key can access) and configured_models (the number selected for this service).
API version header
Requests are sent with theanthropic-version: 2023-06-01 header and authenticated with the x-api-key header, per the Anthropic API.Events it handles
WEBHOOK_CHALLENGE— verify the webhook endpoint.HEALTH_CHECK— probe the Anthropic/v1/modelsendpoint with the configured key.METRIC_UPDATE— report available and configured model counts.DEPLOYMENT_CREATED— verify the key and publish the connection details as outputs.DEPLOYMENT_DELETED— stop tracking the connection (nothing external is torn down).FUNCTION_CALL— run a named function.