1 from openai import OpenAI
2
3 client = OpenAI(
4− base_url="https://api.openai.com/v1",
5+ base_url='https://api.recallrai.com/api/v1/forward/https://api.openai.com/v1',
6 api_key='sk-...',
7+ default_headers={
8+ 'X-Recallr-API-Key': 'rai-...',
9+ 'X-Recallr-Project-Id': 'your-project-id',
10+ 'X-Recallr-Allow-New-User-Creation': 'true',
11+ 'X-Recallr-Session-Timeout-Seconds': '600',
12+ }
13 )
14
15 # Memory is automatically injected on every call
16 response = client.chat.completions.create(
17 model="gpt-5.5",
18 messages=[{"role": "user", "content": "My name is Mayank"}],
19+ extra_headers={
20+ 'X-Recallr-User-Id': 'user-123',
21+ 'X-Recallr-Recall-Strategy': 'low_latency',
22+ }
23 )
24
25 print(response.choices[0].message.content)