Authentication
Siraya AI uses API keys for authentication. You can manage your keys in the Dashboard.
Using an API key
Our API follows the standard Bearer token authentication schema. This makes it compatible with most HTTP clients and the OpenAI SDK.
Setting the Authorization Header
If you're calling the Siraya AI API directly, set the Authorization header to your API key:
Examples
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://llm.siraya.pro/v1',
apiKey: '<API_KEY>'
});
async function main() {
const completion = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: 'Say this is a test' }],
});
console.log(completion.choices[0].message);
}
main();
Protecting Your API Keys
Always keep your API keys secure:
* Never commit keys to public repositories.
* Use environment variables (e.g., process.env.SIRAYA_API_KEY) to manage keys in production.
* Rotate your keys immediately if you suspect they have been exposed.
Siraya AI is a GitHub secret scanning partner. If your key is detected in a public repository, we will automatically disable it and notify you via email.