Text

Text Generation Quickstart

This quickstart walks you through making your first text generation request with Infron.

Using the Infron API directly

curl https://llm.onerouter.pro/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
  "model": "deepseek/deepseek-v3.2",
  "messages": [
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
}'

The API also supports streaming.

Using the OpenAI SDK

Get started with just a few lines of code using your preferred SDK or framework.

from openai import OpenAI

client = OpenAI(
  base_url="https://llm.onerouter.pro/v1",
  api_key="<API_KEY>",
)

completion = client.chat.completions.create(
  model="deepseek/deepseek-v3.2",
  messages=[
    {
      "role": "user",
      "content": "What is the meaning of life?"
    }
  ]
)

print(completion.choices[0].message.content)

Using third-party SDKs

For information about using third-party SDKs and frameworks with Infron, please see our frameworks documentation.

Next steps

Last updated