API Documentation

Quick integration guide and complete API reference

Quickstart

Go live in 3 minutes

If this is your first time here, you do not need to understand every technical term first. Create an account, generate an API key, and copy the example request below to verify your integration.

The current API supports the OpenAI Chat Completions-compatible format, so you can integrate with the OpenAI SDK or compatible clients directly. OpenAI Responses-compatible and Anthropic Messages-compatible formats will be added later.

We recommend starting with the text endpoint. It is the simplest path and the fastest way to confirm your setup works.

Base URL
https://api.weiapi.ai/v1

Send your first text request

Best place to start

If you only want to confirm that your account, API key, and base URL are configured correctly, test with this minimal example first.

curl https://api.weiapi.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL_ID",
    "messages": [
      {"role": "user", "content": "你好,请介绍一下你自己"}
    ],
    "stream": false
  }'

What should success look like?

If the response contains model-generated content, your integration is live. If you get a 401, check the API key. If you get a 404, verify the model ID.