---
title: "Run a primitive"
method: POST
path: "/v2/workspaces/{id}/playground/{op}"
tags: ["Playground"]
---

# Run a primitive

`POST /v2/workspaces/{id}/playground/{op}`

## Request

- Base URL: `https://api.infolang.ai`
- URL: `https://api.infolang.ai/v2/workspaces/{id}/playground/{op}`
- Auth: HTTP bearer

Runs one of `remember | recall | encode | similarity | execute` against Kairos. `args` is positional: remember/recall/encode take `args[0]` as the text/query; similarity takes `args[0]`/`args[1]`; for execute, `args` is the operations array. Non-2xx Kairos statuses are passed through with the Kairos body in `result`.

## Path parameters

- `id` string, required
- `op` 'remember' | 'recall' | 'encode' | 'similarity' | 'execute', required

## Request body

- object
  - `args` unknown[]
    - unknown
  - `namespace` string

## Response `200`

Kairos result plus billing headers and observed latency

- object
  - `result` unknown
  - `headers` object, required
    - `tokens_saved` number
    - `overage` number
  - `latency_ms` number, required

## Other responses

- `401`: Missing or invalid session token
- `403`: Caller lacks a grant on the workspace, or role too low. Or `lane_not_supported` — an `il_live_`/`il_test_`/`il_oauth_` credential, though valid, was presented to a route that accepts the session lane only
- `422`: Unsupported op or invalid args (gateway-side validation)
- `default`: Kairos non-2xx statuses (e.g. 403, 422, 503) pass through verbatim wrapped in the SAME playground envelope — `result` carries the raw Kairos body (or null if it was not JSON), not a V2 error

---

[API](https://skmtc.dev/infolang/apis/infolang-api.md) · [All operations](https://skmtc.dev/infolang/apis/infolang-api/llms.txt) · [OpenAPI document](https://skmtc.dev/infolang/apis/infolang-api/revisions/d04bf6de72c8?raw)
