DeepFellow DOCS

Secure Anthropic Inference with DeepFellow

Use Claude models through DeepFellow's anonymization layer via the native Anthropic SDK or the OpenAI-compatible API.

Using Anthropic Claude models through DeepFellow is safer than using them directly thanks to our anonymization layer.

You need to have an Anthropic API Key and the "claude" service installed — read how to install services in the Infra Web Panel guide.

Native Anthropic SDK

DeepFellow exposes a native Anthropic-compatible endpoint at /v1/messages. Point the Anthropic SDK at your DeepFellow server, and all other Anthropic SDK features work without any code changes.

The Anonymize and Abuse Detection plugins apply to /v1/messages in streaming and non-streaming requests. thinking blocks keep the anonymization tokens, because Anthropic rejects a changed thinking block when the client sends it back.

curl -X 'POST' \
  'https://deepfellow-server-host/v1/messages' \
  -H 'Authorization: Bearer DEEPFELLOW_PROJECT_API_KEY' \
  -H 'anthropic-version: 2023-06-01' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "claude-opus-4-6",
  "max_tokens": 1024,
  "messages": [
    {
      "role": "user",
      "content": "Explain how AI works."
    }
  ]
}'

Error Format

On /v1/messages, DeepFellow Server returns errors in the Anthropic error format instead of the OpenAI-style error format of the OpenAI-compatible endpoints:

{
    "type": "error",
    "error": {
        "type": "invalid_request_error",
        "message": "messages: Field required"
    }
}

The Anthropic error format also covers the following errors:

  • If DeepFellow Infra returns an error other than 401, the status stays the same. error.message holds the message of DeepFellow Infra.
  • If DeepFellow Infra is unreachable, the status is 502.
  • If DeepFellow Infra rejects the API key of DeepFellow Server with 401, the status is 500.
  • If DeepFellow Server fails with an internal error, the status is 500. The response also contains rayid, the ID under which DeepFellow Server logs the error.

error.type depends on the status:

Statuserror.type
401authentication_error
402billing_error
403permission_error
404not_found_error
413request_too_large
429rate_limit_error
Other 4xxinvalid_request_error
504timeout_error
529overloaded_error
Other 5xxapi_error

An error that DeepFellow Infra sends after the response stream starts passes through unchanged.

OpenAI SDK

DeepFellow also provides an OpenAI-compatible API, so you can use the OpenAI SDK with Claude models by pointing it at your DeepFellow server.

from openai import OpenAI

client = OpenAI(
    api_key="DEEPFELLOW_PROJECT_API_KEY",
    base_url="https://deepfellow-server-host/v1",
)

response = client.chat.completions.create(
    model="claude-opus-4-6",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {
            "role": "user",
            "content": "Explain how AI works."
        }
    ]
)

print(response.choices[0].message.content)

We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.

On this page