Anthropic Messages Compatibility

Anthropic Messages API with DEVUP AI

Connect official Anthropic SDKs and compatible developer tools directly to DEVUP AI. Our dedicated translation gateway exposes a native Messages API endpoint at https://api.devupai.com/anthropic, allowing you to route tool use, Server-Sent Events streaming, and multi-turn conversations with zero client code modifications.

Looking for Claude Code CLI integration? We have a dedicated setup guide covering environment functions and model alias overrides.
Claude Code Guide

System Architecture

How Anthropic Clients Connect to DEVUP AI

Anthropic SDK clients append /v1/messages to their configured base URL. By setting baseURL to https://api.devupai.com/anthropic, requests target POST /anthropic/v1/messages. DEVUP AI translates messages, content blocks, and tool definitions before dispatching inference to the underlying model.

1. Client
Anthropic SDK
@anthropic-ai/sdk, Python
2. Gateway
Messages API
POST /anthropic/v1/messages
3. Translation
Adapter Layer
Pure schema transformation
4. Response
Anthropic Wire
SSE deltas & tool_use

Client Configuration

Quickstart with Official Anthropic SDKs

TS

TypeScript & JavaScript (Official @anthropic-ai/sdk npm package)

Install the official Anthropic client and point baseURL to DEVUP AI:

bash
npm install @anthropic-ai/sdk
typescript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.devupai.com/anthropic",
  apiKey: process.env.DEVUP_API_KEY,
});

async function main() {
  const message = await client.messages.create({
    model: "claude-opus-5",
    max_tokens: 1024,
    messages: [{ role: "user", content: "What is the capital of Algeria?" }],
  });

  const textBlock = message.content.find((b) => b.type === "text");
  console.log(textBlock?.text);
}

main();
PY

Python (Official anthropic PyPI package)

Install via pip and point the base_url parameter to DEVUP AI:

bash
pip install anthropic
python
import os
import anthropic

client = anthropic.Anthropic(
    base_url="https://api.devupai.com/anthropic",
    api_key=os.environ["DEVUP_API_KEY"],
)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=1024,
    messages=[{"role": "user", "content": "What is the capital of Algeria?"}],
)

print(message.content[0].text)

Protocol Specifications

Supported Request & Response Schema

Supported Request Parameters

  • modelRequired · Target model identifier
  • messagesRequired · Array of user/assistant turns
  • max_tokensRequired · Integer (1 - 32,768)
  • systemOptional · System prompt string or blocks
  • temperatureOptional · Sampling temperature
  • top_pOptional · Nucleus sampling
  • stop_sequencesOptional · Custom stop string array
  • streamOptional · Boolean for SSE streaming
  • toolsOptional · JSON Schema tool definitions
  • tool_choiceOptional · auto, any, none, or tool

Verified Response Fields

  • idAnthropic format message ID (msg_...)
  • typeFixed literal "message"
  • roleFixed literal "assistant"
  • contentArray of text and tool_use blocks
  • modelRequested model identifier
  • stop_reasonend_turn, max_tokens, or tool_use
  • usageinput_tokens & output_tokens

Real-Time Streaming

Anthropic Server-Sent Events Lifecycle

Setting stream: true delivers the complete Anthropic SSE stream lifecycle. The adapter emits standard events in exact sequential order:

1. message_start

Emits message metadata, ID envelope, and requested model.

2. content_block_start

Initializes a new text or tool_use block index.

3. content_block_delta

Streams text_delta chunks or incremental input_json_delta fragments.

4. content_block_stop

Closes the active content block index.

5. message_delta

Provides stop_reason and finalized input/output token counts.

6. message_stop

Signals stream completion to the client.

Token usage timing: Finalized input_tokens and output_tokens arrive in message_delta upon completion, adhering strictly to Anthropic SSE specifications.

Agent Capabilities

Tool Use & Multi-Turn Message Semantics

Full Tool Calling Lifecycle

Supply standard Anthropic tools with JSON Schema definitions. When a model triggers a tool, the response returns a tool_use content block and sets stop_reason: "tool_use".

During streaming, arguments stream incrementally via input_json_delta carrying partial_json fragments.

Stateless Multi-Turn Conversations

DEVUP AI is completely stateless; conversation state is client-supplied in each request's messages array, never stored or persisted on the server.

Return tool outputs by appending a user turn with a tool_result content block referencing the original tool_use_id.

Authentication

Accepted Authentication Headers

x-api-key Header (Default)

Official Anthropic SDKs send your API key in the x-api-key header by default. DEVUP AI accepts this header natively without requiring client overrides.

x-api-key: sk-devup-...

Authorization: Bearer Token

For unified gateway clients or HTTP proxies, standard Authorization Bearer tokens are also fully accepted and parsed by the endpoint.

Authorization: Bearer sk-devup-...

Start Building with Anthropic Messages on DEVUP AI

Create an API key in your dashboard, configure your base URL, and leverage production foundation models through Anthropic SDKs today.