Skip to main content

Chat Completions

The chat completions API is compatible with OpenAI, so you can use any supported client to interact with the model. Simply pass in the model you want to use and use https://hub.oxen.ai/api as your base_url.
curl -X POST https://hub.oxen.ai/api/chat/completions \
-H "Authorization: Bearer $OXEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "moonshotai/Kimi-K2-Thinking",
  "messages": [{"role": "user", "content": "Hello, how are you?"}]
}'
If you want to send an image to a model that supports vision such as GPT-4o or Claude, you can add a message with the image_url type.
curl -X POST https://hub.oxen.ai/api/chat/completions \
-H "Authorization: Bearer $OXEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "What is in this image?"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://oxen.ai/assets/images/homepage/hero-ox.png"
          }
        }
      ]
    }
  ]
}'

Playground Interface

The model playground allows you to quickly test out the boundaries of any model by chatting with it in the UI. This is a great way to kick the tires of a model you fine-tuned after deploying it. Chat Interface