Compatibility

Anthropic format

For Claude Code and the tools and SDKs built for Anthropic. Change the base URL and the key, keep everything else.

Value
Base URLhttps://api.unaligned.pw/anthropic
MessagesPOST /v1/messages
Keyx-api-key: … or Authorization: Bearer …

Anthropic clients add /v1 themselves: give them https://api.unaligned.pw/anthropic as is.

With the Anthropic SDK

import os
from anthropic import Anthropic

client = Anthropic(base_url="https://api.unaligned.pw/anthropic", api_key=os.environ["UNALIGNED_KEY"])

message = client.messages.create(
    model="gpt-6-luna",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello"}],
)
print(message.content[0].text)

Supported

  • messages, system, max_tokens, temperature, top_p, top_k, stop_sequences.
  • stream, with the standard Anthropic event sequence.
  • tools and tool_choice, on models that support them.

Images in messages (and in tool results) go inline, as base64 sources: JPEG, PNG, GIF or WebP, up to 5 MB each, on models with vision. Documents too (base64, text or content sources). Nothing is fetched: url and file sources are refused, as are the Batches and Files APIs. The anthropic-version header is accepted and ignored.