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.

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

Response (abridged):
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. The complete request still goes to /v1/messages under the unified request URL. If you use the official Anthropic SDK or Claude Code, configure the client’s base_url as https://api-direct.dimilinks.com/ and let the client append /v1/messages automatically:
See Anthropic Messages for details.

4. Enable streaming

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