aboutsummaryrefslogtreecommitdiff
path: root/apps/docs/model-enhancement/getting-started.mdx
blob: 7af3bfab635d08a8894cd4aebfb9be7f5bcab1a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: "Getting Started with Model Enhancement"
sidebarTitle: "Quickstart"
description: "Superpower your LLM in one line"
---

import GettingAPIKey from '/snippets/getting-api-key.mdx';

## Get your supermemory API key

<GettingAPIKey />

## Get your LLM provider's API key

Head to your LLM provider's dashboard and get your API key.

- [OpenAI](https://platform.openai.com/api-keys)
- [Gemini](https://aistudio.google.com/apikey)
- [Anthropic](https://console.anthropic.com/account/keys)
- [Groq](https://console.groq.com/keys)

## Choose your endpoint

<CodeGroup>

```bash OpenAI
https://api.supermemory.ai/v3/https://api.openai.com/v1/chat/completions
```


```bash Gemini
https://api.supermemory.ai/v3/https://generativelanguage.googleapis.com/v1beta/openai
```


```bash Anthropic
https://api.supermemory.ai/v3/https://api.anthropic.com/v1
```


```bash Groq
https://api.supermemory.ai/v3/https://api.groq.com/openai/v1
```


```bash Other provider
https://api.supermemory.ai/v3/<your-provider's-openai-endpoint>
```

</CodeGroup>

## Making your first request

<CodeGroup>

```bash cURL
curl https://api.supermemory.ai/v3/https://api.openai.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "x-supermemory--api-key: $SUPERMEMORY_API_KEY" \
  -H 'x-sm-user-id: user_id' \
  -d '{
    "model": "gpt-5",
    "messages": [
      {"role": "user", "content": "What is the capital of France?"}
    ]
  }'
```


```
```


```typescript TypeScript
import OpenAI from 'openai';

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: 'https://api.supermemory.ai/v3/https://api.openai.com/v1',
  defaultHeaders: {
    'x-supermemory-api-key': process.env.SUPERMEMORY_API_KEY,
    'x-sm-user-id': 'your-user-id'
  }
});

const completion = await openai.chat.completions.create({
  model: "gpt-5",
/// you can also add user here
  user: "user",
  messages: [
    { role: "user", content: "What is the capital of France?" }
  ]
});

  console.debug(completion.choices[0].message);
```

</CodeGroup>