# API reference: AI assistants

> The AI assistants endpoints (1 operations), generated from the OpenAPI document (https://faraatarjomeh.com/api/v1/openapi.json). For task-level walkthroughs use the guides; for error handling use /api/v1/docs/errors. The full reference: /api/v1/docs/reference.

## At a glance

- Auth on every call: `Authorization: Bearer $FARA_API_KEY`
- `scope`: `read` for GET/HEAD, `write` for the rest
- **spends Fara**: the call holds or charges Fara; get the price first and send `Idempotency-Key`
- Path parameters in the examples are shell variables (`$JOB_ID`, `$ID` …)
- Errors: `application/problem+json` with a stable `code` (not repeated per endpoint below)

## Index

- **AI assistants**: [POST /api/v1/mcp](#callMcpEndpoint)

## AI assistants

Model Context Protocol endpoint: AI assistants use the API through it.

<a id="callMcpEndpoint"></a>
### POST /api/v1/mcp

Model Context Protocol endpoint for AI assistants

- operationId `callMcpEndpoint` · scope `write` · free · send `Idempotency-Key`

One JSON-RPC 2.0 request per POST (stateless, JSON answers only). Methods: `initialize`, `ping`, `tools/list`, `tools/call`. A notification (no `id`) gets `202` with no body. The tools are thin wrappers over this API and use the same key, so the same scopes, limits and prices apply. Tool failures come back inside the result with `isError: true`. Jobs that cost Fara need the user's yes first. Guide: /api/v1/docs/guides/mcp. Answers `404` while the endpoint is switched off.

**Parameters**

| Name | In | Type | Required | Notes |
|---|---|---|---|---|
| `Idempotency-Key` | header | string | no | see /api/v1/docs/conventions#idempotency |

**Request body** `application/json` (required)

**Response `200`**

**Responses**

- `200` The JSON-RPC answer (`result` or `error`). (`application/json`)
- `202` A notification was received. The body is empty.
- Errors: `400`, `401`, `403`, `404`, `409`, `422`, `429`, `503` — problem+json, see /api/v1/docs/errors

**Example**

```bash
curl -sS -X POST "https://faraatarjomeh.com/api/v1/mcp" \
  -H "Authorization: Bearer $FARA_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Schemas

Named request and response objects used above. Nested objects are flattened as `parent.child`; arrays as `parent[].child`.
