AkashML

Documentation

Introduction
Claude Code
List models (Anthropic shape) GETAnthropic base health probe GETCreate a message (Anthropic shape) POST
Anthropic SDK
List models GET
Create chat completion POSTCreate completion POST
Platform
Parameter controlsPresetsInferences
Models
Settings
API ReferenceAnthropic

Create a message (Anthropic shape)

POST
/anthropic/v1/messages

Anthropic-compatible Messages endpoint. Internally translates to the upstream OpenAI-compatible inference path.

Streaming. When stream: true is set, the response content type switches to text/event-stream and Anthropic-shaped events are emitted. Event types:

  • message_start — message envelope with id, model, role, usage.
  • content_block_start — start of a content block (text, tool_use, thinking).
  • content_block_delta — incremental content (text delta, input_json_delta, thinking_delta).
  • content_block_stop — end of a content block.
  • message_delta — running stop_reason / usage updates.
  • message_stop — terminal event.
  • ping — keep-alive.
  • error — terminal error event (see error type mapping below).

Model ID aliasing. Slashes in upstream model IDs are aliased with -- — pass anthropic--claude-3-5-sonnet to target anthropic/claude-3-5-sonnet.

Error response shape. All non-2xx responses use { type: "error", error: { type, message } }. Status → error.type mapping:

Statuserror.type
400invalid_request_error
401authentication_error
403permission_error
404not_found_error
413request_too_large
429rate_limit_error (response includes Retry-After header)
500api_error
503 / 529overloaded_error

Authorization

BearerAuth
AuthorizationBearer <token>

API key passed as Bearer token

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/anthropic/v1/messages" \  -H "Content-Type: application/json" \  -d '{    "model": "string",    "messages": [      {}    ],    "max_tokens": 0  }'
{
  "id": "string",
  "type": "message",
  "role": "assistant",
  "content": [
    {}
  ],
  "model": "string",
  "stop_reason": null,
  "stop_sequence": null,
  "usage": {
    "input_tokens": 0,
    "output_tokens": 0
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "string"
  }
}

Anthropic base health probe GET

Lightweight probe used by Claude Code when it first connects to the base URL. Always returns `{ status: "ok" }`.

Anthropic SDK

Use the Anthropic-compatible Messages API to call AkashML's open source models from Claude clients.

model*string

Model identifier. Slashes in upstream IDs are aliased with -- — e.g., pass anthropic--claude-3-5-sonnet to target anthropic/claude-3-5-sonnet.

messages*array<>

Conversation history. Each message is { role: "user" | "assistant", content: string | ContentBlock[] }. Content blocks include text, tool_use, tool_result, and thinking.

max_tokens*integer

Maximum number of tokens to generate before stopping. Required by Anthropic's API.

system?|array<>

System prompt. Either a string or an array of content blocks.

temperature?number

Sampling temperature between 0 and 1.

top_p?number

Nucleus sampling probability mass threshold.

top_k?integer

Sample from the top K options for each subsequent token.

stop_sequences?array<string>

Sequences that will cause the model to stop generating.

stream?boolean

If true, the response is sent as a Server-Sent Events stream (text/event-stream) of Anthropic-shaped events. See the response description for the event types.

tools?array<>

Definitions of tools the model may call.

tool_choice?object

Controls how the model selects tools. { type: "auto" }, { type: "any" }, { type: "tool", name: "..." }.

thinking?object

Extended thinking configuration: { type: "enabled", budget_tokens: number }.

metadata?object

Optional request metadata (e.g., user_id).

[key: string]?any