base_url and api_key, you can add the capabilities of Inworld Router to your existing apps.
Endpoint
The OpenAI-compatible API endpoint is available at:https://api.openai.com/v1 to https://api.inworld.ai/v1.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Realtime TTS-2 is live. Built for realtime conversation that feels human. Learn more
base_url and api_key, you can add the capabilities of Inworld Router to your existing apps.
https://api.inworld.ai/v1
https://api.openai.com/v1 to https://api.inworld.ai/v1.
from openai import OpenAI
# Initialize the client with Inworld Router credentials
client = OpenAI(
base_url="https://api.inworld.ai/v1",
api_key="YOUR_INWORLD_API_KEY" # Your Inworld API Key
)
# Call your router
response = client.chat.completions.create(
model="inworld/<router-id>",
messages=[
{"role": "user", "content": "Who created you?"}
]
)
print(response.choices[0].message.content)
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://api.inworld.ai/v1',
apiKey: 'YOUR_INWORLD_API_KEY',
});
async function main() {
const completion = await openai.chat.completions.create({
messages: [{ role: 'user', content: 'Who created you?' }],
model: 'inworld/demo-router'
});
console.log(completion.choices[0].message.content);
}
main();
Was this page helpful?