Skip to main content
After creating an API key, send a simple request to test whether the API is available.

Endpoint

POST https://www.duiapi.com/v1/messages

Authentication and model selection

Send x-api-key in the request headers and specify the model you want to use.
<API_KEY> Replace with your API key, such as sk-xxxxxx
<MODEL> Replace with the model you use, such as qwen3.7-max

Request examples

curl -sS 'https://www.duiapi.com/v1/messages' \
  -X POST \
  -H 'content-type: application/json' \
  -H 'x-api-key: <API_KEY>' \
  -H 'anthropic-version: 2023-06-01' \
  -H 'anthropic-dangerous-direct-browser-access: true' \
  --data-binary '{
    "model": "<MODEL>",
    "max_tokens": 64,
    "messages": [
      {
        "role": "user",
        "content": "just say hello world"
      }
    ]
  }'

Common errors

HTTP statusCauseHow to fix
401The key is invalid, disabled, or expiredCheck the x-api-key header or create a new token
400 insufficient_user_quotaAccount balance or key quota is insufficientRecharge your account
400 model_not_foundThe model does not exist, or is outside this key or group scopeConfirm the model ID and group in Model Marketplace
429Rate limit triggeredRetry with exponential backoff, or reduce concurrency
The type and code fields in error responses contain more specific error categories. Branch on these fields in your client instead of parsing only the message text.

Next steps

After one request works, continue exploring: