For the complete documentation index, see llms.txt. This page is also available as Markdown.

Authentication

API Authentication

Infron authenticates requests using Bearer tokens, which means you can use curl, Python clients, or the OpenAI SDK directly with Infron.

Using an API key

To use an API key, first create your key. Give it a name.

If you're calling the Infron AI API directly, set the Authorization header to a Bearer token with your API key.

If you're using the OpenAI Typescript SDK, set the api_base to https://llm.onerouter.pro/v1 and the apiKey to your API key.

fetch('https://llm.onerouter.pro/v1/chat/completions', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <API_KEY>',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'openai/gpt-4o',
    messages: [
      {
        role: 'user',
        content: 'What is the meaning of life?',
      },
    ],
  }),
});
import OpenAI from 'openai';

const openai = new OpenAI({
  baseURL: 'https://llm.onerouter.pro/v1',
  apiKey: '<API_KEY>'
});

async function main() {
  const completion = await openai.chat.completions.create({
    model: 'openai/gpt-4o',
    messages: [{ role: 'user', content: 'Say this is a test' }],
  });

  console.log(completion.choices[0].message);
}

main();

If your key has been exposed

You must protect your API keys and never commit them to public repositories.

Infron is a GitHub secret scanning partner, and has other methods to detect exposed keys. If we determine that your key has been compromised, you will receive an email notification.

If you receive such a notification or suspect your key has been exposed, immediately visit your key settings page to delete the compromised key and create a new one.

Using environment variables and keeping keys out of your codebase is strongly recommended.

Last updated