Page cover

Authentication

The LLM relay uses Bearer tokens for authentication. Your API key acts as the Bearer token, which must be included in the Authorization header when making requests.

A Bearer token is a secure, stateless method of verifying API requests.

Direct API requests

Set the Authorization header to Bearer <1RPC_AI_API_KEY> if you're making direct API calls.

import openai
openai.api_base = "https://1rpc.ai/v1"
openai.api_key = "<1RPC_AI_API_KEY>"

OpenAI TypeScript SDK

Set the api_base to https://1rpc.ai/v1 and pass your API key as theapiKey .

import OpenAI from 'openai';
const openai = new OpenAI({
  baseURL: 'https://1rpc.ai/v1',
  apiKey: '<1RPC_AI_API_KEY>',
});

Last updated