DEVUP Docs
Back to Dashboard

Integrations

Anthropic Messages API & Claude Code

An Anthropic Messages-compatible endpoint on DEVUP AI. Existing Anthropic clients, tools, and workflows connect by updating a single base URL.

DEVUP AI exposes a dedicated endpoint implementing the Anthropic Messages protocol. All calls are billed in Algerian Dinars (DZD) in line with standard DEVUP AI token rates.

Looking for high-level features, SDK quickstarts, and client configuration?

Anthropic Messages Overview →

Endpoint & Authentication

POSThttps://api.devupai.com/anthropic/v1/messages

The endpoint accepts your DEVUP AI API key in either of two standard header formats:

x-api-keysk-devup-...
AuthorizationBearer sk-devup-...

The anthropic-version: 2023-06-01 header is accepted and ignored — send it or omit it, the response is identical.

Verified Feature Support

FeatureStatus
Non-streaming messagesSupported (HTTP 200)
Streaming (stream: true)Supported (Full event lifecycle)
Tool use (non-streaming)Supported (tool_use blocks, stop_reason: "tool_use")
Tool use (streaming)Supported (input_json_delta with partial_json)
Multi-turn conversationsSupported (Verified via Claude Code)

Basic Request

Construct a standard Messages API payload specifying the target model, max token budget, and message history:

A final assistant message is kept as conversation history, and the model answers with a new assistant message.

curl https://api.devupai.com/anthropic/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: $DEVUP_API_KEY" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "messages": [
      {
        "role": "user",
        "content": "What is the capital of Algeria?"
      }
    ]
  }'

Response Shape

The API returns a standard Anthropic message structure:

json
{
  "id": "msg_01X9b8Cd3Ef7Gh2Jk4Lm5Np6",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-5",
  "content": [
    {
      "type": "text",
      "text": "The capital of Algeria is Algiers."
    }
  ],
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 16,
    "output_tokens": 8
  }
}

Streaming

Pass stream: true to receive a Server-Sent Events (SSE) stream.

bash
curl https://api.devupai.com/anthropic/v1/messages \
  -H "Content-Type: application/json" \
  -H "x-api-key: $DEVUP_API_KEY" \
  -d '{
    "model": "claude-opus-5",
    "max_tokens": 1024,
    "stream": true,
    "messages": [
      {
        "role": "user",
        "content": "Count from 1 to 3."
      }
    ]
  }'

Event Lifecycle

A streaming response delivers events in the following sequential order:

  1. message_start — Initial message envelope with message ID and model metadata.
  2. content_block_start — Starts a new content block index.
  3. content_block_delta — Incremental text deltas (text_delta).
  4. content_block_stop — Closes the active content block index.
  5. message_delta — Final stop reason and usage statistics.
  6. message_stop — Stream completion marker.
Token usage timing: input_tokens arrives in message_delta at the end of the stream, not in message_start. Usage metrics are finalized once generation completes.

Complete wire format of a streaming exchange:

text
event: message_start
data: {"type":"message_start","message":{"id":"msg_01X9b8Cd3Ef7Gh2Jk4Lm5Np6","type":"message","role":"assistant","model":"claude-opus-5","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":0,"output_tokens":0}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"1, 2, 3."}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":14,"output_tokens":6}}

event: message_stop
data: {"type":"message_stop"}

Tool Use

Supply a tools array defining JSON Schema parameters. When the model invokes a tool, the response contains a tool_use block and sets stop_reason: "tool_use".

Request with Tools

json
{
  "model": "claude-opus-5",
  "max_tokens": 1024,
  "tools": [
    {
      "name": "get_weather",
      "description": "Get the current weather for a location.",
      "input_schema": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "description": "The city and country, e.g. Algiers, Algeria"
          }
        },
        "required": ["location"]
      }
    }
  ],
  "messages": [
    {
      "role": "user",
      "content": "What is the weather in Algiers?"
    }
  ]
}

Tool Call Response

json
{
  "id": "msg_01Y8kLm3N2P4Qr5St6Uv7Wx8",
  "type": "message",
  "role": "assistant",
  "model": "claude-opus-5",
  "content": [
    {
      "type": "tool_use",
      "id": "call_9a8b7c6d",
      "name": "get_weather",
      "input": {
        "location": "Algiers, Algeria"
      }
    }
  ],
  "stop_reason": "tool_use",
  "stop_sequence": null,
  "usage": {
    "input_tokens": 78,
    "output_tokens": 22
  }
}

For streaming requests with tool execution, arguments stream incrementally via content_block_delta events carrying input_json_delta payloads with partial_json fragments.

Models

The endpoint is model-agnostic: it accepts any model identifier from the DEVUP catalogue, not only claude-* names. Pass the model name exactly as listed in the catalogue:

Model IdentifierRole
claude-opus-5Flagship reasoning and complex coding
claude-sonnet-5High capability balanced execution
claude-fable-5Creative and structured generation
claude-opus-4-8Deep analysis and multi-step reasoning
claude-opus-4-7High-precision analytical synthesis
claude-sonnet-4-6Balanced reasoning and generation
claude-haiku-4-5Low latency and fast utility tasks

Verified Models

Model IdentifierVerified Capabilities
claude-opus-5text
deepseek-ai/DeepSeek-V4-Protext, streaming, tool use, full tool cycle, and end-to-end via Claude Code v2.1.238

verified 2026-08-26. Models not listed are expected to work but have not been tested on this endpoint.

Agent Requirement

Claude Code is an agent and requires a model that supports tool calling. A model without tool support will return text and the agent will not complete its loop.

Strict model resolution: A model name that is not in the catalogue returns 404 not_found_error. The endpoint never approximates or maps unknown names to another model. A typo in a request fails immediately with an error rather than silently billing for an unintended model.
json
{
  "type": "error",
  "error": {
    "type": "not_found_error",
    "message": "The requested model was not found."
  }
}

Limits

The largest accepted max_tokens is the model's own max_output_tokens in GET /v1/models, which differs from model to model. Read it for one model with GET /v1/models/deepseek-ai/DeepSeek-V4-Pro, for example.

  • A max_tokens up to the model's max_output_tokens returns HTTP 200.
  • A larger value returns HTTP 400 with an invalid_request_error whose message gives the model's limit, for example, for a model whose max_output_tokens is N:
json
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "max_tokens must be between 1 and N."
  }
}

Model at Capacity

When the model is momentarily at capacity, the endpoint returns HTTP 529 with an overloaded_error and the Retry-After: 5 and retry-after-ms: 5000 headers. Retry after the indicated delay; the Anthropic SDKs retry it automatically.

json
{
  "type": "error",
  "error": {
    "type": "overloaded_error",
    "message": "This model is currently at capacity. Retry in a few seconds."
  }
}

Clients like Claude Code send their own max_tokens with each request. Set it to at most the model's max_output_tokens: for Claude Code, with CLAUDE_CODE_MAX_OUTPUT_TOKENS, as in the next section.

Claude Code

Configure Claude Code to route requests to DEVUP AI by setting environment variables in your active shell:

export ANTHROPIC_BASE_URL="https://api.devupai.com/anthropic"
export ANTHROPIC_API_KEY="sk-devup-..."
export ANTHROPIC_MODEL="deepseek-ai/DeepSeek-V4-Pro"
export CLAUDE_CODE_MAX_OUTPUT_TOKENS="8192"  # at most the model's max_output_tokens in GET /v1/models

Execution Modes

Run Claude Code with the configured environment:

bash
claude --bare                 # interactive session
claude -p "your prompt"       # single prompt, non-interactive

Unrecognized Model Notice

Every invocation prints:

text
[claude-code:unrecognized_model] {"model":"...","query_source":"generate_session_title"}

This is emitted by the client, not by DEVUP AI, and is expected when the model name is not one the client ships with.

The --bare Requirement

Tested on Claude Code v2.1.238:

CommandResult
claude -p "..."Works (Non-interactive prompt)
claude --bareWorks (Interactive session)
claudeNot logged in · Please run /login

Tested on Claude Code v2.1.246:

CommandResult
claude -p "..."Works (Non-interactive prompt)
claude --bareWorks (Interactive session)
claudeWorks (Interactive session, no login prompt)

The login behaviour changed between these two client versions, with both results measured on 2026-08-26, and the --bare guidance below still applies to clients that require it.

Claude Code documentation states that under --bare, authentication is strictly resolved via ANTHROPIC_API_KEY or apiKeyHelper, bypassing OAuth and system keychain lookups. Default interactive mode checks OAuth and the keychain first, prompting for a login rather than reading the environment variable.

Trade-offs of --bare: The --bare flag disables hooks, Language Server Protocol (LSP), plugin synchronization, automatic CLAUDE.md discovery, and keychain access. For automated or scripted tasks needing these capabilities, use claude -p. Note that this is client behaviour and may change across Claude Code releases.

Troubleshooting

If Claude Code was previously used in the same directory with another account, cached credentials in the local .claude folder take precedence over environment variables. Remove the local .claude directory and retry.

Anthropic SDK

Initialize official Anthropic SDKs by pointing the base URL parameter to https://api.devupai.com/anthropic:

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": "Hello!"}
    ],
)

print(message.content[0].text)