OiOi

API Users

Pull your team's Contexts into any product surface.

Use Oi as the prompt source of truth for assistants, internal tools, jobs, and workflow automation.

Why developers care

No prompt strings in code

Fetch one shared Context instead of hardcoding prompts into product routes, workers, and tools.

One source of truth

Use the same context across assistants, internal tools, jobs, and product workflows.

Update without deploys

Change the Context in Oi and let clients pick up the latest version.

Public to private path

Start from public contexts, then use private org-specific versions through the same API shape.

Contexts

Context API

Get Context

Fetch one Context directly. Use the Context slug, for example `designer`.

# current version curl -sS \ -H "Authorization: Bearer $OI_API_KEY" \ "https://api.oioioi.ai/v1/contexts/:slug" # specific historical version curl -sS \ -H "Authorization: Bearer $OI_API_KEY" \ "https://api.oioioi.ai/v1/contexts/:slug?version=2"

List Contexts

Use limit and cursor for simple pagination. Start here when you want to see what your team has available.

# default fields include markdown content curl -sS \ -H "Authorization: Bearer $OI_API_KEY" \ "https://api.oioioi.ai/v1/contexts?limit=10"

Context Request and Response Types

Use these language definitions as the query parameter and response shape reference. These GET endpoints do not accept JSON request bodies.

Did you know?

  • `content` is the compiled markdown Context payload for display, inspection, and durable client behavior.
type ContextResponse = { name: string; shortDescription: string; content?: string; usage?: { usageEventId: string; source: "api"; operation: "get_context"; promptTokenEstimate?: number; }; }; type ListContextsResponse = { items: ContextResponse[]; pagination: { page: number; pageSize: number; totalCount: number; totalPages: number; nextCursor?: string; hasNextPage: boolean; }; }; type ListContextsQueryParams = { cursor?: string; limit?: number; }; type GetContextPathParams = { slug: string; }; type GetContextQueryParams = { version?: number; }; type GetContextResponse = ContextResponse;

Context Example Responses

Use these JSON payloads as concrete examples of Context API responses.

Get Context

{ "name": "Designer", "shortDescription": "Reviews flows, UX details, and design direction.", "content": "# Designer\n\nReviews flows, UX details, and design direction.\n\n## Instructions\n\nAct as the organization's design collaborator.", "usage": { "usageEventId": "usage_123", "source": "api", "operation": "get_context", "promptTokenEstimate": 620 } }

List Contexts

{ "items": [ { "name": "Designer", "shortDescription": "Reviews flows, UX details, and design direction.", "content": "# Designer\n\nReviews flows, UX details, and design direction.\n\n## Instructions\n\nAct as the organization's design collaborator." } ], "pagination": { "page": 1, "pageSize": 10, "totalCount": 24, "totalPages": 3, "nextCursor": "context#designer", "hasNextPage": true } }

Workflows

Workflow API

List Workflows

List organization Workflows for the API key's organization. Use `q`, `limit`, `page`, or `cursor` to search and paginate.

curl -sS \ -H "Authorization: Bearer $OI_API_KEY" \ "https://api.oioioi.ai/v1/workflows?limit=10"

Get Workflow

Fetch one organization Workflow by `workflowId`. Use `?version=2` to request a historical version.

curl -sS \ -H "Authorization: Bearer $OI_API_KEY" \ "https://api.oioioi.ai/v1/workflows/:workflowId"

Workflow Response Type

Organization Workflow responses follow the same top-level shape as Contexts: `content` is the compiled markdown payload.

type WorkflowResponse = { name: string; shortDescription: string; content?: string; usage?: { usageEventId: string; source: "api"; operation: "get_workflow"; promptTokenEstimate?: number; }; }; type PublicWorkflowDetailResponse = WorkflowResponse; type ListWorkflowResponse = { items: WorkflowResponse[]; pagination: { page: number; pageSize: number; totalCount: number; totalPages: number; nextCursor?: string; hasNextPage: boolean; }; };

Workflow Example Responses

Guardrails appear inside the compiled Workflow `content` and nested Contexts expose markdown `content` inside that compiled payload.

Get Workflow

{ "name": "Launch Review", "shortDescription": "Run a launch-readiness review.", "content": "# Launch Review\n\nRun a launch-readiness review...", "usage": { "usageEventId": "usage_456", "source": "api", "operation": "get_workflow" } }

Get Workflows

{ "items": [ { "name": "Launch Review", "shortDescription": "Run a launch-readiness review.", "content": "# Launch Review\n\nRun a launch-readiness review..." } ], "pagination": { "page": 1, "pageSize": 10, "totalCount": 24, "totalPages": 3, "nextCursor": "workflow#launch-review", "hasNextPage": true } }

Errors

Error payloads use a small JSON shape that can be handled the same way across Context and Workflow endpoints.

{ "error": "entitlement_feature_unavailable(feature:api_access,plan:free,required:pro)", "feature": "api_access", "requiredPlan": "pro", "upgradePath": "/dashboard/organization/billing" }