Gengxi API Developer Docs

Anthropic Messages

Use Anthropic Messages-compatible endpoints for messages and token counting.

Create a message

bashCopy
curl https://api.gengxi.ai/v1/messages \
  -H "x-api-key: $GENGXI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL",
    "max_tokens": 512,
    "messages": [{"role": "user", "content": "Hello"}]
  }'

Count tokens

Use POST /v1/messages/count_tokens with the same compatible message shape when a client needs a token estimate before generation.

textCopy
POST https://api.gengxi.ai/v1/messages/count_tokens

Model and client availability

This route is intended for clients that support an Anthropic Messages-compatible endpoint. Model availability depends on the API key, group, and selected model.