You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Connect AI/ML API to your AI client — **Claude Desktop, Claude (web), Cursor, Claude Code**, and other MCP-capable apps — over the [Model Context Protocol](https://modelcontextprotocol.io/) using **OAuth**.
8
+
Connect AIMLAPI to your AI client — **Claude Desktop, Claude (web), Cursor, Claude Code**, and other MCP-capable apps — over the [Model Context Protocol](https://modelcontextprotocol.io/) using **OAuth**.
9
9
10
-
You sign in with your AI/ML API account in the browser; there is **no API key to copy or paste**. Once connected, you can discover and compare models, run inference (LLM / image / video / audio / embeddings), manage long-running generation jobs, and check your balance — directly from the client.
10
+
You sign in with your AIMLAPI account in the browser; there is **no API key to copy or paste**. Once connected, you can discover and compare models, run inference (LLM / image / video / audio / embeddings), manage long-running generation jobs, and check your balance — directly from the client.
11
11
12
12
Usage is billed to your AIMLAPI account, exactly like the REST API.
13
13
14
-
{% hint style="info" %}
15
-
Prefer to paste an API key instead of signing in? That method is also supported — add an `Authorization: Bearer <YOUR_AIMLAPI_KEY>` header instead of using OAuth. This guide covers the **OAuth** (browser sign-in) flow.
16
-
{% endhint %}
17
-
18
-
***
14
+
> Prefer to paste an API key instead of signing in? That method is also supported — add an `Authorization: Bearer <YOUR_AIMLAPI_KEY>` header instead of using OAuth. This guide covers the **OAuth** (browser sign-in) flow.
19
15
20
16
## Prerequisites
21
17
22
-
* An **AI/ML API account** — create one at [https://aimlapi.com](https://aimlapi.com/).
18
+
* An **AIMLAPI account** — create one at [https://aimlapi.com](https://aimlapi.com/).
23
19
* A client that supports **remote MCP servers over Streamable HTTP with OAuth** (all clients below do).
24
20
* A balance on your account if you plan to run billable inference (top up at [https://aimlapi.com/app/billing](https://aimlapi.com/app/billing)).
21
+
***A correct system clock.** OAuth tokens are time-sensitive — if your computer's date, time, or time zone is wrong, the sign-in will fail (and some clients won't even start the session). Make sure the clock is set automatically / synced before you begin.
25
22
26
23
## Endpoint
27
24
@@ -33,87 +30,38 @@ You only ever enter this **one URL**. Your client discovers everything else (the
33
30
34
31
## How the OAuth connection works
35
32
36
-
{% stepper %}
37
-
{% step %}
38
-
## Contacts the MCP server
39
-
40
-
When you add the server URL **without an API key**, your client contacts the MCP server and is told that authentication is required.
41
-
{% endstep %}
42
-
43
-
{% step %}
44
-
## Discovers the authorization server
45
-
46
-
Your client automatically discovers the AIMLAPI authorization server.
47
-
{% endstep %}
48
-
49
-
{% step %}
50
-
## Registers and opens your browser
51
-
52
-
Your client registers itself and opens your browser.
53
-
{% endstep %}
54
-
55
-
{% step %}
56
-
## Signs you in and connects
33
+
When you add the server URL **without an API key**, your client:
57
34
58
-
You **sign in to AI/ML API** and **approve access**; the client receives a token and connects.
59
-
{% endstep %}
60
-
{% endstepper %}
35
+
1. Contacts the MCP server and is told that authentication is required.
36
+
2. Automatically discovers the AIMLAPI authorization server.
37
+
3. Registers itself and opens your browser.
38
+
4. You **sign in to AIMLAPI** and **approve access**; the client receives a token and connects.
61
39
62
40
You never handle a key. The client stores the token securely and refreshes it for you.
63
41
64
-
***
42
+
> **Note on the "Connect" button (Claude Desktop & web).** Adding the connector only _registers_ it — it does not sign you in. After you add it, the connector appears with a **Connect** button; you must click **Connect** to open the browser and complete the AIMLAPI sign-in. Until you click **Connect** and approve, the connector stays added but **not authenticated**, and its tools will not work.
2.**Name:**`AIMLAPI` · **Remote MCP server URL:**`https://mcp.aimlapi.com/mcp`
48
+
3. Click **Add**. The connector is now registered.
49
+
4. Click **Connect** on the AIMLAPI connector. A browser window opens → **sign in to AIMLAPI** → **approve access**.
50
+
5. The connector shows **connected**, and the AIMLAPI tools become available in your chats.
51
+
6.**Verify:** open a chat and ask _"Use AIMLAPI to check my account balance."_ A returned balance confirms the connection and authorization are working.
71
52
72
-
Go to **Settings → Connectors → Add custom connector**.
73
-
{% endstep %}
74
-
75
-
{% step %}
76
-
## Add AIMLAPI
77
-
78
-
Set **Name:**`AIMLAPI` · **Remote MCP server URL:**`https://mcp.aimlapi.com/mcp`
79
-
{% endstep %}
80
-
81
-
{% step %}
82
-
## Sign in and connect
83
-
84
-
Click **Add**. A browser window opens → **sign in to AIMLAPI** → **approve access**.
85
-
86
-
The connector appears as **connected**, and the AI/ML API tools become available in your chats.
Open **Settings → Connectors → Add custom connector**.
97
-
98
-
On Team/Enterprise plans this is done by an Owner under **Organization settings → Connectors**.
99
-
{% endstep %}
57
+
1. Open **Settings → Connectors → Add custom connector** (on Team/Enterprise plans this is done by an Owner under **Organization settings → Connectors**).
58
+
2. Enter the URL `https://mcp.aimlapi.com/mcp` and add it.
59
+
3. Click **Connect** on the AIMLAPI connector. A browser flow opens → **sign in to AIMLAPI** → **approve** → connected.
60
+
4.**Verify:** ask _"Use AIMLAPI to check my account balance."_
100
61
101
-
{% step %}
102
-
## Add the server URL
62
+
> Custom-connector availability depends on your Claude plan.
103
63
104
-
Enter the URL `https://mcp.aimlapi.com/mcp` and add it.
105
-
{% endstep %}
106
-
107
-
{% step %}
108
-
## Complete the browser flow
109
-
110
-
A browser flow opens → **sign in to AI/ML API** → **approve** → connected.
111
-
{% endstep %}
112
-
{% endstepper %}
113
-
114
-
{% hint style="info" %}
115
-
Custom-connector availability depends on your Claude plan.
@@ -129,84 +77,62 @@ Add the server to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project).
129
77
}
130
78
```
131
79
132
-
{% stepper %}
133
-
{% step %}
134
-
## Open Cursor tools settings
135
-
136
-
Open **Cursor Settings → Tools & Integrations**, find **aimlapi**, and click **Login**.
137
-
{% endstep %}
80
+
Then open **Cursor Settings → Tools & Integrations** and find **aimlapi**. It usually appears **Disabled** first — click **···→ Enable**, then click **Login**. A browser opens → **sign in to AIMLAPI** → **Allow**. The server turns green when connected.
138
81
139
-
{% step %}
140
-
## Sign in and allow access
82
+
**Verify:** in an Agent chat, ask _"Using aimlapi, check my account balance."_
141
83
142
-
A browser opens → **sign in to AI/ML API** → **Allow**.
143
-
{% endstep %}
84
+
**Remove:** Cursor cannot delete an MCP server from the UI — the **···** menu only offers Configure / Reload / Enable. To remove it, open `~/.cursor/mcp.json` (the **Configure** dialog shows its path) and delete the `aimlapi` block, then **Reload** or restart Cursor. Note: turning off the source toggle only hides the server from the UI — the entry stays in the file until you delete it there.
144
85
145
-
{% step %}
146
-
## Confirm connection
147
-
148
-
The server turns green when connected.
149
-
{% endstep %}
150
-
{% endstepper %}
151
-
152
-
## Claude Code
86
+
## Claude Code (CLI)
153
87
154
88
```bash
155
89
claude mcp add --transport http aimlapi https://mcp.aimlapi.com/mcp
156
90
```
157
91
158
-
{% stepper %}
159
-
{% step %}
160
-
## Open the MCP menu
161
-
162
-
Inside an interactive Claude Code session, run **`/mcp`**.
163
-
{% endstep %}
92
+
By default this adds the server in **local** scope — it is only available inside the current folder / project. To make it available everywhere, add `--scope user`:
164
93
165
-
{% step %}
166
-
## Select AIMLAPI
94
+
```bash
95
+
claude mcp add --transport http --scope user aimlapi https://mcp.aimlapi.com/mcp
96
+
```
167
97
168
-
Select **aimlapi** and choose **Authenticate**.
169
-
{% endstep %}
98
+
Then, inside an interactive Claude Code session, run **`/mcp`**, select **aimlapi**, and choose **Authenticate** — a browser opens for you to sign in. (Do **not** pass an `--header` flag; that switches the client to API-key auth instead of OAuth.)
170
99
171
-
{% step %}
172
-
## Sign in in the browser
100
+
**Verify:** run `claude mcp list` (the server should show as connected), or in a session ask _"Use the aimlapi MCP to check my account balance."_
173
101
174
-
A browser opens for you to sign in. (Do **not** pass an `--header` flag; that switches the client to API-key auth instead of OAuth.)
175
-
{% endstep %}
176
-
{% endstepper %}
102
+
**Remove:**`claude mcp remove aimlapi` (confirm with `claude mcp list`).
177
103
178
104
## Other MCP clients
179
105
180
-
Any client implementing the MCP authorization spec (OAuth 2.1 + PKCE with dynamic client registration) works the same way: point it at `https://mcp.aimlapi.com/mcp` with no API key and complete the browser sign-in.
181
-
182
-
To inspect the flow step by step, use the MCP Inspector:
106
+
Any client implementing the MCP authorization spec (OAuth 2.1 + PKCE with dynamic client registration) works the same way: point it at `https://mcp.aimlapi.com/mcp` with no API key and complete the browser sign-in. To inspect the flow step by step, use the MCP Inspector:
183
107
184
108
```bash
185
109
npx @modelcontextprotocol/inspector@latest
186
110
```
187
111
188
112
Set **Transport = Streamable HTTP**, **URL = `https://mcp.aimlapi.com/mcp`**, then use **Open Auth Settings → Quick OAuth Flow**.
189
113
190
-
***
191
-
192
114
## What you can do once connected
193
115
194
-
***Discover models** — search and compare the catalog, and get a comparable headline price for each.
116
+
***Discover models** — search and compare the catalog, get a comparable headline price.
| Cursor | Edit `~/.cursor/mcp.json` and delete the `aimlapi` block (cannot be removed from the UI), then Reload / restart Cursor. |
132
+
| Claude Code |`claude mcp remove aimlapi`. |
133
+
134
+
**Clean reinstall.** Removing the connector in the client does not always revoke the OAuth token on the AIMLAPI side. For a fully clean reinstall — one that shows the sign-in / approval screen again — also revoke the app's access in your AIMLAPI account (**Authorized apps / Connections → Revoke**) before adding the server back.
| Browser didn't open, or the client is stuck "connecting" | Remove the connector and add it again; make sure you completed the AI/ML API sign-in in the browser. |
210
-
| Connected, but inference fails with an insufficient-balance error | Top up at [https://aimlapi.com/app/billing](https://aimlapi.com/app/billing). |
211
-
| The client connects but never asks you to sign in | You likely added an `Authorization` header — with a header the client uses API-key auth, not OAuth. Remove the header to use OAuth. |
212
-
| "Sign-in failed" / authorization error | Confirm you're signing in to the correct AI/ML API account, then retry from the client. |
138
+
<table data-search="false"><thead><tr><th>Symptom</th><th>Fix</th></tr></thead><tbody><tr><td>Browser didn't open, or the client is stuck "connecting"</td><td>Remove the connector and add it again; make sure you clicked <strong>Connect</strong> and completed the AIMLAPI sign-in in the browser.</td></tr><tr><td>Session won't start / "clock is set incorrectly" / sign-in fails immediately</td><td>Your system clock is wrong. Set the date, time, and time zone automatically, then retry — OAuth tokens are time-sensitive.</td></tr><tr><td>Connector added but tools don't work</td><td>You likely didn't click <strong>Connect</strong> (Desktop / web) or <strong>Enable + Login</strong> (Cursor). The connector must be authenticated, not just added.</td></tr><tr><td>Server shows <strong>Disabled</strong> in Cursor after editing <code>mcp.json</code></td><td>Open <strong>···→ Enable</strong>, then <strong>Login</strong> to authenticate.</td></tr><tr><td>MCP works in one folder but is missing in another (Claude Code)</td><td>It was added in <strong>local</strong> scope. Re-add with <code>--scope user</code> to make it global.</td></tr><tr><td>Reinstalled but never asked to sign in again</td><td>The old OAuth token is still valid. Revoke the app in <strong>AIMLAPI → Authorized apps</strong>, then reconnect.</td></tr><tr><td>Connected, but inference fails with an insufficient-balance error</td><td>Top up at <a href="https://aimlapi.com/app/billing">https://aimlapi.com/app/billing</a>.</td></tr><tr><td>The client connects but never asks you to sign in</td><td>You likely added an <code>Authorization</code> header — with a header the client uses API-key auth, not OAuth. Remove the header to use OAuth.</td></tr><tr><td>"Sign-in failed" / authorization error</td><td>Confirm you're signing in to the correct AIMLAPI account, then retry from the client.</td></tr></tbody></table>
0 commit comments