canonical: https://jentic.com/apis/orq.ai/orq

# orq.ai API

The orq.ai API runs and operates LLM applications on the orq.ai platform: it routes chat completions, embeddings, rerank, moderation, speech, image, and OCR calls across model providers, and invokes prompt deployments by their key. Around that inference layer it manages the building blocks of an LLM app, including versioned prompts and tools, agents with schedules, knowledge bases with datasources, chunks, and search, memory stores, and datasets of datapoints for evaluation. Operations teams can query logs and traces with OQL, run evaluators, redact PII from text, and set budgets, routing rules, guardrail rules, and alerts for a workspace.

## For AI agents

Call LLMs through orq.ai's router or invoke a saved deployment by key, search a knowledge base, run evaluators against outputs, redact PII, and query traces and logs to see how an LLM application behaved.

## Scope

Does not host your own model weights, train or fine-tune base models, or serve as a vector database outside orq.ai knowledge bases. Use for running and operating LLM applications on the orq.ai platform only.

## Capabilities

- Invoke a prompt deployment by its key with inputs and messages through `/v2/deployments/invoke`, or stream it through `/v2/deployments/stream`
- Route chat completions, embeddings, rerank, and moderation requests through the `/v2/router` endpoints
- Search a knowledge base with a query, top_k, threshold, and search_type, and manage its datasources and chunks
- Version prompts and tools, then read back a specific prompt version through `/v2/prompts/{prompt_id}/versions/{version_id}`
- Detect, redact, and restore personal data in text with the `/v2/pii` operations
- Query traces and logs with OQL over a from and to time window, and fetch a trace's spans and conversation
- Invoke a custom evaluator against a query, output, and reference through `/v3/evaluators/{id}/invoke`

## Use cases

### Agents calling governed LLM deployments through Jentic

An agent that needs an LLM answer calls an orq.ai deployment instead of a raw model, so the prompt, model choice, and guardrails configured in orq.ai apply. Through Jentic the agent finds the DeploymentInvoke operation by intent, passes the required key plus inputs or messages, and gets the completion back, while your own Jentic One instance injects the orq.ai API key at call time.

Example prompt: POST `/v2/deployments/invoke` with key 'customer-support-answer' and inputs {"question": "How do I reset my password?"}, then return the generated message

### Retrieval over a managed knowledge base

Teams building retrieval-augmented answers keep documents in an orq.ai knowledge base, add datasources, and let orq.ai chunk them. The SearchKnowledge operation takes a query plus optional top_k, threshold, and search_type, and returns matching chunks, while ListChunks and UpdateChunkEnabled let an operator inspect or switch off chunks that produce bad answers.

Example prompt: POST `/v2/knowledge/{knowledge_id}/search` with query 'refund policy for annual plans' and top_k 5, then summarise the returned chunks

### PII redaction before model calls

Applications that send user text to models often need personal data removed first. The PIIRedact operation takes text with optional language, entities, and threshold settings and returns redacted text, PIIDetect reports what was found, and PIIRestore puts the original values back into a model's response when the caller is allowed to see them.

Example prompt: POST `/v2/pii/redact` with text 'Call Maria Lopez at +34 600 123 456' and language 'en', then pass the redacted text to the next step

### Trace and log investigation with OQL

When an LLM feature misbehaves, engineers query orq.ai traces with OQL over a time window, open the failing trace, and read its spans and conversation. TracesQueryOql requires from, to, and oql, and TracesGetConversation returns the exchange the user saw, so an agent can assemble an incident summary from real telemetry.

Example prompt: POST `/v3/traces/query` with from '2026-11-11T09:00:00Z', to '2026-11-11T10:00:00Z', and an oql filter for error spans, then GET `/v3/traces/{trace_id}/spans` for the first result

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/v2/deployments/invoke` | Invoke a deployment by key |
| POST | `/v2/router/chat/completions` | Create a routed chat completion |
| POST | `/v2/router/embeddings` | Create embeddings |
| POST | `/v2/knowledge/{knowledge_id}/search` | Search a knowledge base |
| GET | `/v2/prompts` | List prompts |
| POST | `/v2/pii/redact` | Redact PII from text |
| POST | `/v3/traces/query` | Query traces with OQL |
| POST | `/v3/evaluators/{id}/invoke` | Invoke a custom evaluator |

## Key resources

- **Deployments** — Invoke, stream, and read the configuration of prompt deployments by key
- **Router** — Provider-routed chat completions, completions, embeddings, rerank, moderation, speech, transcription, image, and OCR calls
- **Knowledge bases** — Knowledge bases with datasources, chunks, processing status, and search
- **Prompts, tools, and agents** — Versioned prompts and tools, agents, and agent schedules
- **Datasets and evaluators** — Datasets of datapoints, evaluators with versions, and evaluator invocation
- **Traces and logs** — OQL queries, facets, aggregates, spans, and conversations for traces and logs
- **Workspace governance** — Budgets, routing rules, guardrail rules, policies, alerts, API keys, and projects

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 57 / 100
- **Maturity:** Foundational
- **Dimensions:**
  - Foundational Compliance: 73 / 100
  - Developer Experience & Jentic Compatibility: 59 / 100
  - AI-Readiness & Agent Experience: 50 / 100
  - Agent Usability: 43 / 100
  - Security: 75 / 100
  - AI Discoverability: 73 / 100
- **View full report:** https://jentic.com/apis/orq.ai/orq/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring orq.ai by hand means bearer auth, choosing between the v2 and v3 surfaces, and handling streaming deployments and router calls yourself. Through Jentic you install once, import orq.ai from the API Directory, store the API key once, and your agent calls it.
- **Permission scoping:** orq.ai puts resource ids in the URL path, such as `/v2/knowledge/{knowledge_id}/search` and `/v2/datasets/{dataset_id}/datapoints`, so a rule can pin your agent to one knowledge base or one dataset. You choose the operations it may call, so destructive ones like DeleteDataset or ApiKeyCreate are not included unless you add them.
- **Credential handling:** Your orq.ai API key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'invoke a deployment' or 'search a knowledge base', and Jentic returns the matching orq.ai operation with its input schema, so the agent picks the right one of hundreds without reading the reference.

## Related APIs

- **OpenRouter API** — Unified model router for chat completions across many providers
- **Portkey API** — AI gateway with routing, guardrails, and observability
- **Langfuse API** — Open-source LLM tracing, prompt management, and evaluation
- **OpenAI API** — Direct access to OpenAI models

## FAQ

### What authentication does the orq.ai API use?

The orq.ai API authenticates with a bearer token per its OpenAPI spec: your orq.ai API key sent as Authorization: Bearer, with the scheme marked as JWT format. A few model catalog lookups, such as GET `/v2/model-catalog`, are declared without security. Through Jentic the key is stored encrypted by your own Jentic One instance and injected at call time, so it never enters the agent's prompt or logs.

### Can I search an orq.ai knowledge base with the API?

Yes. POST `/v2/knowledge/{knowledge_id}/search` requires a query and accepts top_k, threshold, search_type, filter_by, and rerank_config. To keep results clean you can list a datasource's chunks and switch individual chunks off with PATCH `/v2/knowledge/{knowledge_id}/datasources/{datasource_id}/chunks/{chunk_id}/enabled.`

### What are the rate limits for the orq.ai API?

The OpenAPI spec does not specify rate limits. Check the orq.ai documentation at docs.orq.ai for current limits on your plan, and use the budgets operations to cap spend per workspace.

### How do I invoke an orq.ai deployment through Jentic?

Install Jentic One, add the orq.ai API from the Jentic API Directory, and store your orq.ai API key once. Your agent searches for 'invoke an orq.ai deployment', gets DeploymentInvoke with its input schema, and calls POST `/v2/deployments/invoke` with the required key and its inputs or messages. To run it on your own infrastructure, install Jentic One from its GitHub repo.

### Which orq.ai agent endpoints are deprecated?

The spec marks the older agent execution paths as deprecated, including POST `/v2/agents/{key}/task`, POST `/v2/agents/run`, POST `/v2/agents/stream-run`, and the `/v2/agents/{agent_key}/responses` operations. Agent create, list, retrieve, update, and delete under `/v2/agents` remain current, and schedules live under `/v3/agents/{agent_key}/schedules.`

### Is there an orq.ai MCP server?

You don't need an MCP server to give your agent the orq.ai API. Jentic connects it directly from the API Directory: import it, store your credential once, and your agent calls it. With 313 operations in this spec, discovering them on demand keeps hundreds of tool definitions out of the agent's context.

### Can I limit what my agent is allowed to do with the orq.ai API?

Yes. Write a rule that allows only POST `/v2/deployments/invoke` and the search operation under one knowledge_id, and your agent can answer from one knowledge base and call deployments, but cannot delete datasets, mint API keys, or change budgets. Every call it makes is logged by your own Jentic One instance.
