# Connect curl (HTTP) to aicharged.io

> Plain JSON-RPC over HTTP POST — for scripts, debugging and clients without an MCP SDK.

## At a glance

| Kind | Sign-in | Platforms | Status | Verified |
|---|---|---|---|---|
| Plain HTTP | API key (Bearer) | macOS, Linux, Windows | works today | 2026-10-22 |

- MCP: `https://aicharged.io/api/v1/mcp`
- Docs: https://modelcontextprotocol.io/specification

## Recipe

Classic flow: initialize → tools/list → tools/call (MCP 2025-11-25):

```sh
U=https://aicharged.io/api/v1/mcp
H=(-H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -H "Authorization: Bearer <API_KEY>")
curl -s "${H[@]}" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}' "$U"
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2025-11-25" -d '{"jsonrpc":"2.0","method":"notifications/initialized"}' "$U"
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2025-11-25" -d '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' "$U"
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2025-11-25" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_runs","arguments":{}}}' "$U"
```

Modern era without a handshake (MCP 2026-07-28):

```sh
U=https://aicharged.io/api/v1/mcp
H=(-H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -H "Authorization: Bearer <API_KEY>")
M='"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"curl","version":"1.0"},"io.modelcontextprotocol/clientCapabilities":{}}'
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2026-07-28" -H "Mcp-Method: server/discover" -d "{\"jsonrpc\":\"2.0\",\"id\":\"d1\",\"method\":\"server/discover\",\"params\":{$M}}" "$U"
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2026-07-28" -H "Mcp-Method: tools/list" -d "{\"jsonrpc\":\"2.0\",\"id\":2,\"method\":\"tools/list\",\"params\":{$M}}" "$U"
curl -s "${H[@]}" -H "MCP-Protocol-Version: 2026-07-28" -H "Mcp-Method: tools/call" -H "Mcp-Name: list_runs" -d "{\"jsonrpc\":\"2.0\",\"id\":3,\"method\":\"tools/call\",\"params\":{\"name\":\"list_runs\",\"arguments\":{},$M}}" "$U"
```

[Client documentation](https://modelcontextprotocol.io/specification)

## Authentication

- Send `Authorization: Bearer <API_KEY>` with every request. Create a key at https://aicharged.io/admin/account/api-keys.
- OAuth 2.1 (PKCE S256) is available for clients that cannot send a static key (ChatGPT).
- Without a key the endpoint answers 401 with a WWW-Authenticate header that points to https://aicharged.io/.well-known/oauth-protected-resource.

All 51 clients: https://aicharged.io/connect.md

HTML version: https://aicharged.io/connect/curl
