Skip to main content
POST
https://api.compose.market
/
api
/
inference
Generate
curl --request POST \
  --url https://api.compose.market/api/inference \
  --header 'Content-Type: application/json' \
  --data '
{
  "modelId": "<string>",
  "messages": [
    {}
  ]
}
'
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20
  }
}

Body

modelId
string
required
The ID of the model to use (e.g., meta-llama/Meta-Llama-3-8B-Instruct).
messages
array
required
List of messages in standard OpenAI format.
[{ "role": "user", "content": "Hello!" }]

Headers

x-payment
string
The x402 payment signature (required for paid models).
{
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 20
  }
}