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.
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.
Client Configuration
Quickstart with Official Anthropic SDKs
TypeScript & JavaScript (Official @anthropic-ai/sdk npm package)
Install the official Anthropic client and point baseURL to DEVUP AI:
npm install @anthropic-ai/sdkimport 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();Python (Official anthropic PyPI package)
Install via pip and point the base_url parameter to DEVUP AI:
pip install anthropicimport 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
textandtool_useblocks - modelRequested model identifier
- stop_reason
end_turn,max_tokens, ortool_use - usage
input_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:
Emits message metadata, ID envelope, and requested model.
Initializes a new text or tool_use block index.
Streams text_delta chunks or incremental input_json_delta fragments.
Closes the active content block index.
Provides stop_reason and finalized input/output token counts.
Signals stream completion to the client.
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.
Authorization: Bearer Token
For unified gateway clients or HTTP proxies, standard Authorization Bearer tokens are also fully accepted and parsed by the endpoint.
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.