AnLinkAI

Quickstart

From open account access to your first guided test request.

This page is written for developers in the current open access. It assumes you are using the OpenAI-compatible chat completions path and a console-issued API key for guided testing.

curl https://api.anlinkai.com/api/v1/chat/completions \
  -H "Authorization: Bearer ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-flash",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Write a release note headline."}
    ]
  }'

Steps

Recommended integration order

Keep the first pass simple. Validate account access, key issuance, and a single successful request before you expand your traffic shape.

1. Register and sign in

  • Open the console and create your account
  • Confirm you can reach the overview page after login
  • Up to 2 USDT trial balance: 1 USDT to start, 1 USDT after account setup.

2. Create an API key

  • Create one key for your current test environment
  • Copy the plaintext key immediately after creation
  • Store it in server-side environment variables

3. Choose an active model

  • Use the model catalog on the docs site or in the console
  • Start with a model currently marked active
  • Use the exact exposed code such as qwen-flash

4. Send a chat completions request

  • Target https://api.anlinkai.com/api/v1/chat/completions
  • Pass your key as Authorization: Bearer ...
  • Use a small prompt first so failures are easy to inspect

5. Validate the result

  • Confirm the response body is valid JSON
  • Open Usage Logs in the console
  • Check request status, token counts, and recorded cost

6. Manage failures

  • Keep the request ID from failed calls when possible
  • Check whether the model is still active
  • Check whether the account still has remaining USDT balance

Examples

Reference request shapes

These examples are written against the current current API surface, not a future multi-endpoint release.

cURL

curl https://api.anlinkai.com/api/v1/chat/completions \
  -H "Authorization: Bearer ak_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen-flash",
    "messages": [
      {"role": "system", "content": "You are a concise assistant."},
      {"role": "user", "content": "Write a release note headline."}
    ]
  }'

JavaScript

const response = await fetch("https://api.anlinkai.com/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.ANLINK_API_KEY,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    model: "qwen-flash",
    messages: [
      { role: "system", content: "You are a concise assistant." },
      { role: "user", content: "Write a release note headline." }
    ]
  })
});

const data = await response.json();
console.log(data);

JavaScript Streaming

const response = await fetch("https://api.anlinkai.com/api/v1/chat/completions", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.ANLINK_API_KEY,
    "Content-Type": "application/json",
    "Accept": "text/event-stream"
  },
  body: JSON.stringify({
    model: "qwen-flash",
    messages: [
      { role: "system", content: "You are a concise assistant." },
      { role: "user", content: "Write a release note headline." }
    ],
    stream: true,
    stream_options: { include_usage: true }
  })
});

const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = "";

while (true) {
  const { done, value } = await reader.read();
  if (done) break;
  buffer += decoder.decode(value, { stream: true });
  const events = buffer.split("\n\n");
  buffer = events.pop() || "";
  for (const event of events) {
    const data = event.split("\n").find(line => line.startsWith("data:"))?.replace(/^data:\s*/, "");
    if (!data || data === "[DONE]") continue;
    const chunk = JSON.parse(data);
    process.stdout.write(chunk.choices?.[0]?.delta?.content || "");
  }
}

Python

import os
import requests

resp = requests.post(
    "https://api.anlinkai.com/api/v1/chat/completions",
    headers={
        "Authorization": f"Bearer {os.environ['ANLINK_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "qwen-flash",
        "messages": [
            {"role": "system", "content": "You are a concise assistant."},
            {"role": "user", "content": "Write a release note headline."},
        ],
    },
    timeout=60,
)

print(resp.status_code)
print(resp.json())

Checklist

Before you move beyond test traffic

  1. Do not expose your API key in browser-side bundles.
  2. Use one key per environment so revocation stays manageable.
  3. Record failures and compare them with Usage Logs in the console.
  4. Keep prompts and concurrency small until the route is validated.
  5. Top-up bonus: top up with TRC20 USDT and receive 20% extra usable balance after automatic crediting.
  6. Contact support at hello@anlinkai.com if a recharge order enters manual review, or review Billing and Recharge.

Console URL

https://console.anlinkai.com

API base

https://api.anlinkai.com/api/v1

Primary endpoint

POST /chat/completions

FAQ

/faq

Model catalog

/model-catalog

Billing

/billing-and-recharge

Support

hello@anlinkai.com