Guides

Use the Anthropic SDK

Run Anthropic-compatible message requests through Deeplinq.

Deeplinq implements POST /v1/messages and POST /v1/messages/count_tokens. Configure the Anthropic SDK to send requests to your engine.

import Anthropic from "@anthropic-ai/sdk"

const client = new Anthropic({
  apiKey: process.env.DEEPLINQ_TOKEN,
  baseURL: process.env.DEEPLINQ_BASE_URL,
})

const message = await client.messages.create({
  model: "claude-sonnet-4-5",
  max_tokens: 512,
  messages: [
    {
      role: "user",
      content: "Explain why audit logs should be tamper-evident.",
    },
  ],
})

console.log(message.content)

The engine translates the request into its governed provider pipeline while preserving Anthropic response and streaming semantics.

Declare Anthropic's standard web search tool. Deeplinq runs each search with its own search, never the AI company's, and returns the standard server_tool_use, web_search_tool_result and cited text blocks:

const answer = await client.messages.create({
  model: "claude-sonnet-4-5",
  max_tokens: 1024,
  messages: [
    {
      role: "user",
      content: "What happened to lithium prices this week? Cite your sources.",
    },
  ],
  tools: [{ type: "web_search_20250305", name: "web_search", max_uses: 3 }],
})

Every other server tool is refused. See Web search on the chat endpoints for the fields, the streamed events, citations, caps and charging.

Claude Code

Claude Code can use Deeplinq by changing its API base and carrying an engine credential:

ANTHROPIC_BASE_URL="https://api.example.com" \
ANTHROPIC_API_KEY="$DEEPLINQ_TOKEN" \
claude

Model access, spend authorization, metering, and guardrails continue to apply to these requests.

On this page