Quick Start
Welcome to Infron AI — your unified gateway to cutting-edge language, reasoning, and multimodal models. This guide will walk you through setting up your environment, making basic API calls, and exploring advanced features.
Setup your API Key
To begin using Infron AI, you first need to create an account and generate your API Key.
Once you have your API key, set it as an environment variable in your runtime environment. This allows your applications to securely access Infron’s API.
export INFRON_KEY="YOUR_API_KEY"
You can verify the variable is set correctly by running:
echo $INFRON_KEY
If it prints your API key, you’re ready to start making requests.
Submit a demo request
You can interact with Infron AI through two primary methods: direct API calls or using the OpenAI SDK.
Using the Infron API directly
import requests
import json
response = requests.post(
url="https://llm.onerouter.pro/v1/chat/completions",
headers={
"Authorization": f"Bearer {INFRON_KEY}",
"Content-Type": "application/json"
},
data=json.dumps({
"model": "jina/jina-reranker-v3",
"messages": [
{
"role": "user",
"content": "What is the meaning of life?"
}
]
})
)
print(response.json())
This version directly interacts with the REST API endpoint. It is suitable for lightweight integrations or when SDK support is unavailable.
Using the OpenAI SDK
If you already use the OpenAI SDK, Infron's API endpoints are compatible, making it simple to switch or integrate.
from openai import OpenAI
client = OpenAI(
base_url="https://llm.onerouter.pro/v1",
api_key=f"{INFRON_KEY}",
)
completion = client.chat.completions.create(
model="jina/jina-reranker-v3",
messages=[
{
"role": "user",
"content": "What is the meaning of life?"
}
]
)
print(completion.choices[0].message.content)
This method handles authentication and request formatting automatically, providing a smoother developer experience.
Advanced Features
Take your Infron AI integrations further with advanced capabilities such as custom response APIs, structured outputs, and multimodal inputs.
OpenAI-Compatible Responses API
Use this endpoint for tasks that require flexible control over output token limits and format.
import requests
response = requests.post(
'https://llm.onerouter.pro/v1/responses',
headers={
'Authorization': f'Bearer {INFRON_KEY}',
'Content-Type': 'application/json',
},
json={
'model': 'jina/jina-reranker-v3',
'input': 'What is the meaning of life?',
'max_output_tokens': 9000,
}
)
result = response.json()
print(result)
This interface closely mirrors OpenAI’s responses API and offers easy portability across LLM providers.
For more details, refer to the official documentation.
Anthropic Claude-Compatible API
This endpoint allows you to interact with Claude-style conversational models, supporting multi-turn dialogues, system prompts, and tool usage.
import json
import requests
response = requests.post(
"https://llm.onerouter.pro/v1/messages",
headers={"x-api-key":f"{INFRON_KEY}","Content-Type":"application/json"},
data=json.dumps({
"model": "jina/jina-reranker-v3",
"messages": [
{
"role": "user",
"content": "Hello there."
},
{
"role": "assistant",
"content": "Hi, I'm Claude. How can I help you?"
},
{
"role": "user",
"content": "Can you explain LLMs in plain English?"
}
],
"max_tokens": 1024,
"stop_sequences": [],
"stream": False,
"system": [
{
"text": "Today's date is 2024-06-01.",
"type": "text"
}
],
"temperature": 1,
"thinking": {"type": "disabled"},
"tool_choice": {"type": "auto"},
"tools": [
{
"name": "get_stock_price",
"description": "Get the current stock price for a given ticker symbol.",
"input_schema": {
"type": "object",
"properties": {
"ticker": {
"type": "string",
"description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
}
},
"required": ["ticker"]
}
}
],
"top_k": 5,
"top_p": 0.7
})
)
print(response.json())
Check out the Anthropic Claude-Compatible API documentation for more information.
Structured Outputs
Generate predictable, machine-readable results using JSON Schema-based responses. This is especially useful for applications like chatbots, agents, and automated pipelines.
import requests
import json
response = requests.post(
url="https://llm.onerouter.pro/v1/chat/completions",
headers={
"Authorization": f"Bearer {INFRON_KEY}",
"Content-Type": "application/json"
},
data=json.dumps({
"model": "jina/jina-reranker-v3",
"messages": [
{"role": "user", "content": "What's the weather like in London?"}
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "weather",
"strict": True,
"schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City or location name"
},
"temperature": {
"type": "number",
"description": "Temperature in Celsius"
},
"conditions": {
"type": "string",
"description": "Weather conditions description"
}
},
"required": ["location", "temperature", "conditions"],
"additionalProperties": False
}
}
}
})
)
print(response.json())
See the Structured Outputs documentation for full details.
Multimodal Input
Infron supports image and text combinations, enabling richer interactions that go beyond text-only prompts.
Image Inputs
import requests
import json
url = "https://llm.onerouter.pro/v1/chat/completions"
headers = {
"Authorization": f"Bearer {INFRON_KEY}",
"Content-Type": "application/json"
}
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
}
}
]
}
]
payload = {
"model": "jina/jina-reranker-v3",
"messages": messages
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())
Learn more in the Multimodal Input documentation.
Reasoning Tokens
Access specialized models that allocate tokens for complex reasoning, planning, or multi-step thought processes.
from openai import OpenAI
client = OpenAI(
base_url="https://llm.onerouter.pro/v1",
api_key=f"{INFRON_KEY}",
)
response = client.chat.completions.create(
model="jina/jina-reranker-v3",
messages=[
{"role": "user", "content": "How would you build the world's tallest skyscraper?"}
],
extra_body={
"reasoning": {
"max_tokens": 200
}
},
)
print(response.model_dump_json())
Read more about this advanced capability in the Reasoning Tokens documentation.
Related Models
Infron AI is compatible with a wide range of models covering various domains such as text generation, reasoning, coding, and multimodal processing. Refer to the official model catalog to explore all available options.
Next Steps:
- Try customizing prompts for your use case.
- Explore streaming responses for real-time applications.
- Combine structured outputs and multimodal inputs for rich, dynamic experiences.
Your journey with Infron AI starts here — build smarter, faster, and more capable AI applications today.