Skip to content

API Integration Guide

The models.tips homepage publicly demonstrates an OpenAI-compatible Chat Completions route. Before integrating, confirm the active API base URL and your account permissions in the signed-in console.

Required values

  • API base URL from the console.
  • API key created for the application.
  • Model name copied exactly from the Model Marketplace.

curl example

bash
curl -X POST "<API_BASE_URL>/v1/chat/completions" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<MODEL_NAME>",
    "messages": [
      {"role": "user", "content": "Introduce yourself in one sentence."}
    ],
    "stream": false
  }'

Replace the three placeholders with values from your console and the Model Marketplace. Never send a real key through a public channel.

Request fields

  • model: the exact target model name.
  • messages: the conversation message array.
  • role: the role for a message, such as user.
  • content: the text sent to the model.
  • stream: whether to enable a streaming response.

Read the response

For a non-streaming request, model output is commonly available in choices, and token counts may appear in usage. Exact response fields can vary by protocol and model, so treat the returned payload as authoritative.

Streaming responses

When stream is true, the client must process SSE chunks and close the connection after the end marker. Keep stream set to false when the client cannot process streaming output correctly.

Minimal troubleshooting checklist

  • Confirm the base URL does not duplicate /v1.
  • Confirm Authorization uses Bearer and that the key has no surrounding whitespace.
  • Confirm the model name matches exactly.
  • Confirm the JSON is valid and the account has available balance or quota.