Skip to main content
This page uses a single chat/completions request as a minimal example. Image and video generation use different endpoints; after completing this chat request, follow the links at the end of the page to integrate them.

1. Prepare an API key

Create a Bearer key in the console and save it as an environment variable. Send every request from your server; never place the key in browser code or a client application bundle.
export DIMILINKS_API_KEY="sk-..."
Authorization: Bearer <DIMILINKS_API_KEY>
Content-Type: application/json

2. Start a Claude chat through the OpenAI-compatible endpoint

curl "https://dimilinks.com/v1/chat/completions" \
  -H "Authorization: Bearer $DIMILINKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Explain Pluto in one sentence."}
    ]
  }'
Response (abridged):
{
  "id": "chatcmpl_xxx",
  "object": "chat.completion",
  "model": "claude-sonnet-5",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Pluto is a dwarf planet at the outer edge of the Solar System that was once classified as the ninth planet."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 32,
    "completion_tokens": 24,
    "total_tokens": 56
  }
}
Change model to gpt-5.5, gpt-5.6-terra, qwen3.7-max, or another available text model to call it with the same key. If you use the official Anthropic SDK or Claude Code, use the dedicated base URL https://api-direct.dimilinks.com/:
curl "https://api-direct.dimilinks.com/v1/messages" \
  -H "Authorization: Bearer $DIMILINKS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "max_tokens": 256,
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'
See Anthropic Messages for details.

4. Enable streaming

curl "https://dimilinks.com/v1/chat/completions" \
  -H "Authorization: Bearer $DIMILINKS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "stream": true,
    "messages": [
      {"role": "user", "content": "Write a four-line poem about the deep sea."}
    ]
  }'
The server returns a sequence of incremental data: {...} events as text/event-stream, ending with data: [DONE]. See Chat completions for details.

5. Next steps