Skip to content
中文

Anthropic-compatible API

Base URL

https://api.deepraxis.com/anthropic

Get started

curl
curl https://api.deepraxis.com/anthropic/v1/messages \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-flash","max_tokens":1024,"messages":[{"role":"user","content":"你好"}]}'
Python
import os

from anthropic import Anthropic

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

resp = client.messages.create(
    model="deepseek-flash",
    max_tokens=1024,
    messages=[{"role": "user", "content": "你好"}],
)
TypeScript
import Anthropic from "@anthropic-ai/sdk";

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

const resp = await client.messages.create({
  model: "deepseek-flash",
  max_tokens: 1024,
  messages: [{ role: "user", content: "你好" }],
});

Endpoints

MethodPathDescriptionSupport
POST/v1/messagesCreate a Message● Supported
POST/v1/messages/count_tokensCount tokens for a request◐ Partial
GET/v1/modelsList models● Supported
POST/v1/filesUpload a file● Supported
GET/v1/filesList files● Supported
GET/v1/files/{file_id}Get file metadata● Supported
DELETE/v1/files/{file_id}Delete a file● Supported
GET/v1/files/{file_id}/contentDownload file content● Supported

Differences from Anthropic

  • Create a Message:Preserves top-level cache_control, top_k, metadata.user_id, output_config.format, thinking.display and anthropic-user-profile-id. Native-only options restrict routing; requests fail when no provider can preserve them. Nonempty anthropic-workspace-id returns 400. container, inference_geo and service_tier are accepted and ignored; see field support for other extensions. Unknown top-level fields are forwarded unchanged to same-protocol upstream providers, which decide whether to accept them. Declared fields still undergo type and range validation; invalid values return 400 naming the field.
  • Count tokens for a request:Returns a model-family-calibrated estimate, including Chinese text and tool definitions, with the response header x-praxis-token-count: estimated. Do not use it as an exact usage or billing count.
  • List models:Always returns capabilities, max_input_tokens and max_tokens; unknown catalog facts are null. The total context window is not substituted for an independent input limit. Nonempty anthropic-workspace-id returns 400; anthropic-beta version selection is not implemented.
  • Upload a file:SDK 0.128.0 sends form file and optional form expires_in_seconds (3600–7776000 seconds). Any other form field, including purpose, returns 400 invalid_request_error such as “purpose: Extra inputs are not permitted”. The only accepted query parameter is the SDK’s beta; other query parameters return 400, and a query expires_in_seconds is told to move into the form. Uploads are stored as user_data. anthropic-workspace-id is not supported and returns 400.
  • List files:Newest first. Paginate with after_id / before_id and limit (sending both returns 400), or with the page cursor (next_page); use only one of the three. Responses contain data, has_more, first_id, last_id and next_page. ids (up to 100 distinct IDs) is mutually exclusive with page, after_id, before_id and limit. scope_id requires the anthropic-beta: managed-agents-2026-04-01 header; a missing header returns 400 and a nonexistent session scope returns 404. anthropic-workspace-id returns 400.
  • Download file content:Only files produced by the code execution tool can be downloaded; downloading a file you uploaded yourself (purpose user_data) returns 400 invalid_request_error, the same as Anthropic’s own API.

For authoritative parameter definitions, see the official Anthropic documentation.

Errors follow the Anthropic format, see errors; quotas and response headers are covered in rate limits.