# @orq-ai/node

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@orq-ai/node* API.

<div align="left">
    <a href="https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript"><img src="https://custom-icon-badges.demolab.com/badge/-Built%20By%20Speakeasy-212015?style=for-the-badge&logoColor=FBE331&logo=speakeasy&labelColor=545454" /></a>
    <a href="https://opensource.org/licenses/MIT">
        <img src="https://img.shields.io/badge/License-MIT-blue.svg" style="width: 100px; height: 28px;" />
    </a>
</div>

<!-- Start Summary [summary] -->
## Summary

orq.ai API: orq.ai API documentation

For more information about the API: [orq.ai Documentation](https://docs.orq.ai)
<!-- End Summary [summary] -->

<!-- Start Table of Contents [toc] -->
## Table of Contents
<!-- $toc-max-depth=2 -->
* [@orq-ai/node](#orq-ainode)
  * [SDK Installation](#sdk-installation)
  * [Requirements](#requirements)
  * [SDK Example Usage](#sdk-example-usage)
  * [Authentication](#authentication)
  * [Available Resources and Operations](#available-resources-and-operations)
  * [Standalone functions](#standalone-functions)
  * [Server-sent event streaming](#server-sent-event-streaming)
  * [File uploads](#file-uploads)
  * [Retries](#retries)
  * [Error Handling](#error-handling)
  * [Server Selection](#server-selection)
  * [Custom HTTP Client](#custom-http-client)
  * [Debugging](#debugging)
* [Development](#development)
  * [Maturity](#maturity)
  * [Contributions](#contributions)

<!-- End Table of Contents [toc] -->

<!-- Start SDK Installation [installation] -->
## SDK Installation

The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers.

### NPM

```bash
npm add @orq-ai/node
```

### PNPM

```bash
pnpm add @orq-ai/node
```

### Bun

```bash
bun add @orq-ai/node
```

### Yarn

```bash
yarn add @orq-ai/node
```
<!-- End SDK Installation [installation] -->

<!-- Start Requirements [requirements] -->
## Requirements

For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
<!-- End Requirements [requirements] -->

<!-- Start SDK Example Usage [usage] -->
## SDK Example Usage

### Example

```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  await orq.postV2FeedbackEvaluationRemove();
}

run();

```
<!-- End SDK Example Usage [usage] -->

<!-- Start Authentication [security] -->
## Authentication

### Per-Client Security Schemes

This SDK supports the following security scheme globally:

| Name     | Type | Scheme      | Environment Variable |
| -------- | ---- | ----------- | -------------------- |
| `apiKey` | http | HTTP Bearer | `ORQ_API_KEY`        |

To authenticate with the API the `apiKey` parameter must be set when initializing the SDK client instance. For example:
```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  await orq.postV2FeedbackEvaluationRemove();
}

run();

```
<!-- End Authentication [security] -->

<!-- Start Available Resources and Operations [operations] -->
## Available Resources and Operations

<details open>
<summary>Available methods</summary>

### [Orq SDK](docs/sdks/orq/README.md)

* [postV2FeedbackEvaluationRemove](docs/sdks/orq/README.md#postv2feedbackevaluationremove)
* [postV2FeedbackEvaluation](docs/sdks/orq/README.md#postv2feedbackevaluation)

### [Agents](docs/sdks/agents/README.md)

* [postV2AgentsA2a](docs/sdks/agents/README.md#postv2agentsa2a) - Register external A2A agent
* [postV2AgentsKeyCardRefresh](docs/sdks/agents/README.md#postv2agentskeycardrefresh) - Refresh A2A agent card
* [create](docs/sdks/agents/README.md#create) - Create agent
* [list](docs/sdks/agents/README.md#list) - List agents
* [delete](docs/sdks/agents/README.md#delete) - Delete agent
* [retrieve](docs/sdks/agents/README.md#retrieve) - Retrieve agent
* [update](docs/sdks/agents/README.md#update) - Update agent
* [~~invoke~~](docs/sdks/agents/README.md#invoke) - Execute an agent task :warning: **Deprecated**
* [~~run~~](docs/sdks/agents/README.md#run) - Run an agent with configuration :warning: **Deprecated**
* [~~streamRun~~](docs/sdks/agents/README.md#streamrun) - Run agent with streaming response :warning: **Deprecated**
* [~~stream~~](docs/sdks/agents/README.md#stream) - Stream agent execution in real-time :warning: **Deprecated**

### [Agents.Responses](docs/sdks/orqagentsresponses/README.md)

* [create](docs/sdks/orqagentsresponses/README.md#create) - Create response
* [get](docs/sdks/orqagentsresponses/README.md#get) - Get response

### [Annotations](docs/sdks/annotations/README.md)

* [create](docs/sdks/annotations/README.md#create) - Annotate a span
* [delete](docs/sdks/annotations/README.md#delete) - Remove an annotation from a span

### [Chunking](docs/sdks/chunking/README.md)

* [parse](docs/sdks/chunking/README.md#parse) - Parse text

### [Contacts](docs/sdks/contacts/README.md)

* [create](docs/sdks/contacts/README.md#create) - Update user information

### [Datasets](docs/sdks/datasets/README.md)

* [list](docs/sdks/datasets/README.md#list) - List datasets
* [create](docs/sdks/datasets/README.md#create) - Create a dataset
* [retrieve](docs/sdks/datasets/README.md#retrieve) - Retrieve a dataset
* [update](docs/sdks/datasets/README.md#update) - Update a dataset
* [delete](docs/sdks/datasets/README.md#delete) - Delete a dataset
* [listDatapoints](docs/sdks/datasets/README.md#listdatapoints) - List datapoints
* [createDatapoint](docs/sdks/datasets/README.md#createdatapoint) - Create a datapoint
* [retrieveDatapoint](docs/sdks/datasets/README.md#retrievedatapoint) - Retrieve a datapoint
* [updateDatapoint](docs/sdks/datasets/README.md#updatedatapoint) - Update a datapoint
* [deleteDatapoint](docs/sdks/datasets/README.md#deletedatapoint) - Delete a datapoint
* [clear](docs/sdks/datasets/README.md#clear) - Delete all datapoints

### [Deployments](docs/sdks/deployments/README.md)

* [invoke](docs/sdks/deployments/README.md#invoke) - Invoke
* [list](docs/sdks/deployments/README.md#list) - List all deployments
* [getConfig](docs/sdks/deployments/README.md#getconfig) - Get config
* [stream](docs/sdks/deployments/README.md#stream) - Stream

#### [~~Deployments.Metrics~~](docs/sdks/metrics/README.md)

* [~~create~~](docs/sdks/metrics/README.md#create) - Add metrics :warning: **Deprecated**

### [Evals](docs/sdks/evals/README.md)

* [all](docs/sdks/evals/README.md#all) - Get all Evaluators
* [create](docs/sdks/evals/README.md#create) - Create an Evaluator
* [update](docs/sdks/evals/README.md#update) - Update an Evaluator
* [delete](docs/sdks/evals/README.md#delete) - Delete an Evaluator
* [invoke](docs/sdks/evals/README.md#invoke) - Invoke a Custom Evaluator
* [getV2EvaluatorsIdVersions](docs/sdks/evals/README.md#getv2evaluatorsidversions) - List evaluator versions

### [Feedback](docs/sdks/feedback/README.md)

* [postV2Feedback](docs/sdks/feedback/README.md#postv2feedback)
* [postV2FeedbackRemove](docs/sdks/feedback/README.md#postv2feedbackremove)

### [Files](docs/sdks/files/README.md)

* [list](docs/sdks/files/README.md#list) - List all files
* [create](docs/sdks/files/README.md#create) - Create file
* [getContent](docs/sdks/files/README.md#getcontent) - Download file content
* [delete](docs/sdks/files/README.md#delete) - Delete file
* [get](docs/sdks/files/README.md#get) - Retrieve a file
* [update](docs/sdks/files/README.md#update) - Update file

### [GuardrailRules](docs/sdks/guardrailrules/README.md)

* [list](docs/sdks/guardrailrules/README.md#list) - List guardrail rules
* [create](docs/sdks/guardrailrules/README.md#create) - Create guardrail rule
* [delete](docs/sdks/guardrailrules/README.md#delete) - Delete guardrail rule
* [retrieve](docs/sdks/guardrailrules/README.md#retrieve) - Get guardrail rule
* [update](docs/sdks/guardrailrules/README.md#update) - Update guardrail rule

### [HumanReviewSets](docs/sdks/humanreviewsets/README.md)

* [getV2HumanEvalSets](docs/sdks/humanreviewsets/README.md#getv2humanevalsets) - Get all human review sets
* [postV2HumanEvalSets](docs/sdks/humanreviewsets/README.md#postv2humanevalsets) - Create a human review set
* [getV2HumanEvalSetsId](docs/sdks/humanreviewsets/README.md#getv2humanevalsetsid) - Get a human review set by ID
* [patchV2HumanEvalSetsId](docs/sdks/humanreviewsets/README.md#patchv2humanevalsetsid) - Update a human review set
* [deleteV2HumanEvalSetsId](docs/sdks/humanreviewsets/README.md#deletev2humanevalsetsid) - Delete a human review set

### [Identities](docs/sdks/identities/README.md)

* [list](docs/sdks/identities/README.md#list) - List identities
* [create](docs/sdks/identities/README.md#create) - Create an identity
* [retrieve](docs/sdks/identities/README.md#retrieve) - Retrieve an identity
* [update](docs/sdks/identities/README.md#update) - Update an identity
* [delete](docs/sdks/identities/README.md#delete) - Delete an identity

### [Knowledge](docs/sdks/knowledge/README.md)

* [list](docs/sdks/knowledge/README.md#list) - List all knowledge bases
* [create](docs/sdks/knowledge/README.md#create) - Create a knowledge
* [retrieve](docs/sdks/knowledge/README.md#retrieve) - Retrieves a knowledge base
* [update](docs/sdks/knowledge/README.md#update) - Updates a knowledge
* [delete](docs/sdks/knowledge/README.md#delete) - Deletes a knowledge
* [search](docs/sdks/knowledge/README.md#search) - Search knowledge base
* [listDatasources](docs/sdks/knowledge/README.md#listdatasources) - List all datasources
* [createDatasource](docs/sdks/knowledge/README.md#createdatasource) - Create a new datasource
* [retrieveDatasource](docs/sdks/knowledge/README.md#retrievedatasource) - Retrieve a datasource
* [deleteDatasource](docs/sdks/knowledge/README.md#deletedatasource) - Deletes a datasource
* [updateDatasource](docs/sdks/knowledge/README.md#updatedatasource) - Update a datasource
* [createChunks](docs/sdks/knowledge/README.md#createchunks) - Create chunks for a datasource
* [listChunks](docs/sdks/knowledge/README.md#listchunks) - List all chunks for a datasource
* [deleteChunks](docs/sdks/knowledge/README.md#deletechunks) - Delete multiple chunks
* [listChunksPaginated](docs/sdks/knowledge/README.md#listchunkspaginated) - List chunks with offset-based pagination
* [getChunksCount](docs/sdks/knowledge/README.md#getchunkscount) - Get chunks total count
* [updateChunk](docs/sdks/knowledge/README.md#updatechunk) - Update a chunk
* [deleteChunk](docs/sdks/knowledge/README.md#deletechunk) - Delete a chunk
* [retrieveChunk](docs/sdks/knowledge/README.md#retrievechunk) - Retrieve a chunk

### [MemoryStores](docs/sdks/memorystores/README.md)

* [list](docs/sdks/memorystores/README.md#list) - List memory stores
* [create](docs/sdks/memorystores/README.md#create) - Create memory store
* [retrieve](docs/sdks/memorystores/README.md#retrieve) - Retrieve memory store
* [update](docs/sdks/memorystores/README.md#update) - Update memory store
* [delete](docs/sdks/memorystores/README.md#delete) - Delete memory store
* [listMemories](docs/sdks/memorystores/README.md#listmemories) - List all memories
* [createMemory](docs/sdks/memorystores/README.md#creatememory) - Create a new memory
* [retrieveMemory](docs/sdks/memorystores/README.md#retrievememory) - Retrieve a specific memory
* [updateMemory](docs/sdks/memorystores/README.md#updatememory) - Update a specific memory
* [deleteMemory](docs/sdks/memorystores/README.md#deletememory) - Delete a specific memory
* [listDocuments](docs/sdks/memorystores/README.md#listdocuments) - List all documents for a memory
* [createDocument](docs/sdks/memorystores/README.md#createdocument) - Create a new memory document
* [retrieveDocument](docs/sdks/memorystores/README.md#retrievedocument) - Retrieve a specific memory document
* [updateDocument](docs/sdks/memorystores/README.md#updatedocument) - Update a specific memory document
* [deleteDocument](docs/sdks/memorystores/README.md#deletedocument) - Delete a specific memory document

### [Policies](docs/sdks/policies/README.md)

* [list](docs/sdks/policies/README.md#list) - List policies
* [create](docs/sdks/policies/README.md#create) - Create policy
* [delete](docs/sdks/policies/README.md#delete) - Delete policy
* [retrieve](docs/sdks/policies/README.md#retrieve) - Get policy
* [update](docs/sdks/policies/README.md#update) - Update policy

### [Prompts](docs/sdks/prompts/README.md)

* [list](docs/sdks/prompts/README.md#list) - List all prompts
* [create](docs/sdks/prompts/README.md#create) - Create a prompt
* [retrieve](docs/sdks/prompts/README.md#retrieve) - Retrieve a prompt
* [update](docs/sdks/prompts/README.md#update) - Update a prompt
* [delete](docs/sdks/prompts/README.md#delete) - Delete a prompt
* [listVersions](docs/sdks/prompts/README.md#listversions) - List all prompt versions
* [getVersion](docs/sdks/prompts/README.md#getversion) - Retrieve a prompt version

### [Remoteconfigs](docs/sdks/remoteconfigs/README.md)

* [retrieve](docs/sdks/remoteconfigs/README.md#retrieve) - Retrieve a remote config

### [Responses](docs/sdks/responses/README.md)

* [create](docs/sdks/responses/README.md#create) - Create response
* [get](docs/sdks/responses/README.md#get) - Retrieve response

### [Router](docs/sdks/router/README.md)

* [ocr](docs/sdks/router/README.md#ocr) - Extracts text content while maintaining document structure and hierarchy

#### [Router.Audio.Speech](docs/sdks/speech/README.md)

* [create](docs/sdks/speech/README.md#create) - Create speech

#### [Router.Audio.Transcriptions](docs/sdks/transcriptions/README.md)

* [create](docs/sdks/transcriptions/README.md#create) - Create transcription

#### [Router.Audio.Translations](docs/sdks/translations/README.md)

* [create](docs/sdks/translations/README.md#create) - Create translation

#### [Router.Chat.Completions](docs/sdks/orqcompletions/README.md)

* [create](docs/sdks/orqcompletions/README.md#create) - Create chat completion

#### [Router.Completions](docs/sdks/completions/README.md)

* [create](docs/sdks/completions/README.md#create) - Create completion

#### [Router.Embeddings](docs/sdks/embeddings/README.md)

* [create](docs/sdks/embeddings/README.md#create) - Create embeddings

#### [Router.Images.Edits](docs/sdks/edits/README.md)

* [create](docs/sdks/edits/README.md#create) - Create image edit

#### [Router.Images.Generations](docs/sdks/generations/README.md)

* [create](docs/sdks/generations/README.md#create) - Create image

#### [Router.Images.Variations](docs/sdks/variations/README.md)

* [create](docs/sdks/variations/README.md#create) - Create image variation

#### [Router.Moderations](docs/sdks/moderations/README.md)

* [create](docs/sdks/moderations/README.md#create) - Create moderation

#### [Router.Rerank](docs/sdks/rerank/README.md)

* [create](docs/sdks/rerank/README.md#create) - Create rerank

#### [Router.Responses](docs/sdks/orqresponses/README.md)

* [create](docs/sdks/orqresponses/README.md#create) - Create response

### [RoutingRules](docs/sdks/routingrules/README.md)

* [list](docs/sdks/routingrules/README.md#list) - List routing rules
* [create](docs/sdks/routingrules/README.md#create) - Create routing rule
* [delete](docs/sdks/routingrules/README.md#delete) - Delete routing rule
* [retrieve](docs/sdks/routingrules/README.md#retrieve) - Get routing rule
* [update](docs/sdks/routingrules/README.md#update) - Update routing rule

### [Schedules](docs/sdks/schedules/README.md)

* [list](docs/sdks/schedules/README.md#list) - List schedules
* [create](docs/sdks/schedules/README.md#create) - Create schedule
* [delete](docs/sdks/schedules/README.md#delete) - Delete schedule
* [retrieve](docs/sdks/schedules/README.md#retrieve) - Retrieve schedule
* [update](docs/sdks/schedules/README.md#update) - Update schedule
* [trigger](docs/sdks/schedules/README.md#trigger) - Trigger schedule execution

### [Tools](docs/sdks/tools/README.md)

* [list](docs/sdks/tools/README.md#list) - List tools
* [create](docs/sdks/tools/README.md#create) - Create tool
* [update](docs/sdks/tools/README.md#update) - Update tool
* [delete](docs/sdks/tools/README.md#delete) - Delete tool
* [retrieve](docs/sdks/tools/README.md#retrieve) - Retrieve tool
* [getV2ToolsToolIdVersions](docs/sdks/tools/README.md#getv2toolstoolidversions) - List tool versions
* [getV2ToolsToolIdVersionsVersionId](docs/sdks/tools/README.md#getv2toolstoolidversionsversionid) - Get tool version

</details>
<!-- End Available Resources and Operations [operations] -->

<!-- Start Standalone functions [standalone-funcs] -->
## Standalone functions

All the methods listed above are available as standalone functions. These
functions are ideal for use in applications running in the browser, serverless
runtimes or other environments where application bundle size is a primary
concern. When using a bundler to build your application, all unused
functionality will be either excluded from the final bundle or tree-shaken away.

To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).

<details>

<summary>Available standalone functions</summary>

- [`agentsCreate`](docs/sdks/agents/README.md#create) - Create agent
- [`agentsDelete`](docs/sdks/agents/README.md#delete) - Delete agent
- [`agentsList`](docs/sdks/agents/README.md#list) - List agents
- [`agentsPostV2AgentsA2a`](docs/sdks/agents/README.md#postv2agentsa2a) - Register external A2A agent
- [`agentsPostV2AgentsKeyCardRefresh`](docs/sdks/agents/README.md#postv2agentskeycardrefresh) - Refresh A2A agent card
- [`agentsResponsesCreate`](docs/sdks/orqagentsresponses/README.md#create) - Create response
- [`agentsResponsesGet`](docs/sdks/orqagentsresponses/README.md#get) - Get response
- [`agentsRetrieve`](docs/sdks/agents/README.md#retrieve) - Retrieve agent
- [`agentsUpdate`](docs/sdks/agents/README.md#update) - Update agent
- [`annotationsCreate`](docs/sdks/annotations/README.md#create) - Annotate a span
- [`annotationsDelete`](docs/sdks/annotations/README.md#delete) - Remove an annotation from a span
- [`chunkingParse`](docs/sdks/chunking/README.md#parse) - Parse text
- [`contactsCreate`](docs/sdks/contacts/README.md#create) - Update user information
- [`datasetsClear`](docs/sdks/datasets/README.md#clear) - Delete all datapoints
- [`datasetsCreate`](docs/sdks/datasets/README.md#create) - Create a dataset
- [`datasetsCreateDatapoint`](docs/sdks/datasets/README.md#createdatapoint) - Create a datapoint
- [`datasetsDelete`](docs/sdks/datasets/README.md#delete) - Delete a dataset
- [`datasetsDeleteDatapoint`](docs/sdks/datasets/README.md#deletedatapoint) - Delete a datapoint
- [`datasetsList`](docs/sdks/datasets/README.md#list) - List datasets
- [`datasetsListDatapoints`](docs/sdks/datasets/README.md#listdatapoints) - List datapoints
- [`datasetsRetrieve`](docs/sdks/datasets/README.md#retrieve) - Retrieve a dataset
- [`datasetsRetrieveDatapoint`](docs/sdks/datasets/README.md#retrievedatapoint) - Retrieve a datapoint
- [`datasetsUpdate`](docs/sdks/datasets/README.md#update) - Update a dataset
- [`datasetsUpdateDatapoint`](docs/sdks/datasets/README.md#updatedatapoint) - Update a datapoint
- [`deploymentsGetConfig`](docs/sdks/deployments/README.md#getconfig) - Get config
- [`deploymentsInvoke`](docs/sdks/deployments/README.md#invoke) - Invoke
- [`deploymentsList`](docs/sdks/deployments/README.md#list) - List all deployments
- [`deploymentsStream`](docs/sdks/deployments/README.md#stream) - Stream
- [`evalsAll`](docs/sdks/evals/README.md#all) - Get all Evaluators
- [`evalsCreate`](docs/sdks/evals/README.md#create) - Create an Evaluator
- [`evalsDelete`](docs/sdks/evals/README.md#delete) - Delete an Evaluator
- [`evalsGetV2EvaluatorsIdVersions`](docs/sdks/evals/README.md#getv2evaluatorsidversions) - List evaluator versions
- [`evalsInvoke`](docs/sdks/evals/README.md#invoke) - Invoke a Custom Evaluator
- [`evalsUpdate`](docs/sdks/evals/README.md#update) - Update an Evaluator
- [`feedbackPostV2Feedback`](docs/sdks/feedback/README.md#postv2feedback)
- [`feedbackPostV2FeedbackRemove`](docs/sdks/feedback/README.md#postv2feedbackremove)
- [`filesCreate`](docs/sdks/files/README.md#create) - Create file
- [`filesDelete`](docs/sdks/files/README.md#delete) - Delete file
- [`filesGet`](docs/sdks/files/README.md#get) - Retrieve a file
- [`filesGetContent`](docs/sdks/files/README.md#getcontent) - Download file content
- [`filesList`](docs/sdks/files/README.md#list) - List all files
- [`filesUpdate`](docs/sdks/files/README.md#update) - Update file
- [`guardrailRulesCreate`](docs/sdks/guardrailrules/README.md#create) - Create guardrail rule
- [`guardrailRulesDelete`](docs/sdks/guardrailrules/README.md#delete) - Delete guardrail rule
- [`guardrailRulesList`](docs/sdks/guardrailrules/README.md#list) - List guardrail rules
- [`guardrailRulesRetrieve`](docs/sdks/guardrailrules/README.md#retrieve) - Get guardrail rule
- [`guardrailRulesUpdate`](docs/sdks/guardrailrules/README.md#update) - Update guardrail rule
- [`humanReviewSetsDeleteV2HumanEvalSetsId`](docs/sdks/humanreviewsets/README.md#deletev2humanevalsetsid) - Delete a human review set
- [`humanReviewSetsGetV2HumanEvalSets`](docs/sdks/humanreviewsets/README.md#getv2humanevalsets) - Get all human review sets
- [`humanReviewSetsGetV2HumanEvalSetsId`](docs/sdks/humanreviewsets/README.md#getv2humanevalsetsid) - Get a human review set by ID
- [`humanReviewSetsPatchV2HumanEvalSetsId`](docs/sdks/humanreviewsets/README.md#patchv2humanevalsetsid) - Update a human review set
- [`humanReviewSetsPostV2HumanEvalSets`](docs/sdks/humanreviewsets/README.md#postv2humanevalsets) - Create a human review set
- [`identitiesCreate`](docs/sdks/identities/README.md#create) - Create an identity
- [`identitiesDelete`](docs/sdks/identities/README.md#delete) - Delete an identity
- [`identitiesList`](docs/sdks/identities/README.md#list) - List identities
- [`identitiesRetrieve`](docs/sdks/identities/README.md#retrieve) - Retrieve an identity
- [`identitiesUpdate`](docs/sdks/identities/README.md#update) - Update an identity
- [`knowledgeCreate`](docs/sdks/knowledge/README.md#create) - Create a knowledge
- [`knowledgeCreateChunks`](docs/sdks/knowledge/README.md#createchunks) - Create chunks for a datasource
- [`knowledgeCreateDatasource`](docs/sdks/knowledge/README.md#createdatasource) - Create a new datasource
- [`knowledgeDelete`](docs/sdks/knowledge/README.md#delete) - Deletes a knowledge
- [`knowledgeDeleteChunk`](docs/sdks/knowledge/README.md#deletechunk) - Delete a chunk
- [`knowledgeDeleteChunks`](docs/sdks/knowledge/README.md#deletechunks) - Delete multiple chunks
- [`knowledgeDeleteDatasource`](docs/sdks/knowledge/README.md#deletedatasource) - Deletes a datasource
- [`knowledgeGetChunksCount`](docs/sdks/knowledge/README.md#getchunkscount) - Get chunks total count
- [`knowledgeList`](docs/sdks/knowledge/README.md#list) - List all knowledge bases
- [`knowledgeListChunks`](docs/sdks/knowledge/README.md#listchunks) - List all chunks for a datasource
- [`knowledgeListChunksPaginated`](docs/sdks/knowledge/README.md#listchunkspaginated) - List chunks with offset-based pagination
- [`knowledgeListDatasources`](docs/sdks/knowledge/README.md#listdatasources) - List all datasources
- [`knowledgeRetrieve`](docs/sdks/knowledge/README.md#retrieve) - Retrieves a knowledge base
- [`knowledgeRetrieveChunk`](docs/sdks/knowledge/README.md#retrievechunk) - Retrieve a chunk
- [`knowledgeRetrieveDatasource`](docs/sdks/knowledge/README.md#retrievedatasource) - Retrieve a datasource
- [`knowledgeSearch`](docs/sdks/knowledge/README.md#search) - Search knowledge base
- [`knowledgeUpdate`](docs/sdks/knowledge/README.md#update) - Updates a knowledge
- [`knowledgeUpdateChunk`](docs/sdks/knowledge/README.md#updatechunk) - Update a chunk
- [`knowledgeUpdateDatasource`](docs/sdks/knowledge/README.md#updatedatasource) - Update a datasource
- [`memoryStoresCreate`](docs/sdks/memorystores/README.md#create) - Create memory store
- [`memoryStoresCreateDocument`](docs/sdks/memorystores/README.md#createdocument) - Create a new memory document
- [`memoryStoresCreateMemory`](docs/sdks/memorystores/README.md#creatememory) - Create a new memory
- [`memoryStoresDelete`](docs/sdks/memorystores/README.md#delete) - Delete memory store
- [`memoryStoresDeleteDocument`](docs/sdks/memorystores/README.md#deletedocument) - Delete a specific memory document
- [`memoryStoresDeleteMemory`](docs/sdks/memorystores/README.md#deletememory) - Delete a specific memory
- [`memoryStoresList`](docs/sdks/memorystores/README.md#list) - List memory stores
- [`memoryStoresListDocuments`](docs/sdks/memorystores/README.md#listdocuments) - List all documents for a memory
- [`memoryStoresListMemories`](docs/sdks/memorystores/README.md#listmemories) - List all memories
- [`memoryStoresRetrieve`](docs/sdks/memorystores/README.md#retrieve) - Retrieve memory store
- [`memoryStoresRetrieveDocument`](docs/sdks/memorystores/README.md#retrievedocument) - Retrieve a specific memory document
- [`memoryStoresRetrieveMemory`](docs/sdks/memorystores/README.md#retrievememory) - Retrieve a specific memory
- [`memoryStoresUpdate`](docs/sdks/memorystores/README.md#update) - Update memory store
- [`memoryStoresUpdateDocument`](docs/sdks/memorystores/README.md#updatedocument) - Update a specific memory document
- [`memoryStoresUpdateMemory`](docs/sdks/memorystores/README.md#updatememory) - Update a specific memory
- [`policiesCreate`](docs/sdks/policies/README.md#create) - Create policy
- [`policiesDelete`](docs/sdks/policies/README.md#delete) - Delete policy
- [`policiesList`](docs/sdks/policies/README.md#list) - List policies
- [`policiesRetrieve`](docs/sdks/policies/README.md#retrieve) - Get policy
- [`policiesUpdate`](docs/sdks/policies/README.md#update) - Update policy
- [`postV2FeedbackEvaluation`](docs/sdks/orq/README.md#postv2feedbackevaluation)
- [`postV2FeedbackEvaluationRemove`](docs/sdks/orq/README.md#postv2feedbackevaluationremove)
- [`promptsCreate`](docs/sdks/prompts/README.md#create) - Create a prompt
- [`promptsDelete`](docs/sdks/prompts/README.md#delete) - Delete a prompt
- [`promptsGetVersion`](docs/sdks/prompts/README.md#getversion) - Retrieve a prompt version
- [`promptsList`](docs/sdks/prompts/README.md#list) - List all prompts
- [`promptsListVersions`](docs/sdks/prompts/README.md#listversions) - List all prompt versions
- [`promptsRetrieve`](docs/sdks/prompts/README.md#retrieve) - Retrieve a prompt
- [`promptsUpdate`](docs/sdks/prompts/README.md#update) - Update a prompt
- [`remoteconfigsRetrieve`](docs/sdks/remoteconfigs/README.md#retrieve) - Retrieve a remote config
- [`responsesCreate`](docs/sdks/responses/README.md#create) - Create response
- [`responsesGet`](docs/sdks/responses/README.md#get) - Retrieve response
- [`routerAudioSpeechCreate`](docs/sdks/speech/README.md#create) - Create speech
- [`routerAudioTranscriptionsCreate`](docs/sdks/transcriptions/README.md#create) - Create transcription
- [`routerAudioTranslationsCreate`](docs/sdks/translations/README.md#create) - Create translation
- [`routerChatCompletionsCreate`](docs/sdks/orqcompletions/README.md#create) - Create chat completion
- [`routerCompletionsCreate`](docs/sdks/completions/README.md#create) - Create completion
- [`routerEmbeddingsCreate`](docs/sdks/embeddings/README.md#create) - Create embeddings
- [`routerImagesEditsCreate`](docs/sdks/edits/README.md#create) - Create image edit
- [`routerImagesGenerationsCreate`](docs/sdks/generations/README.md#create) - Create image
- [`routerImagesVariationsCreate`](docs/sdks/variations/README.md#create) - Create image variation
- [`routerModerationsCreate`](docs/sdks/moderations/README.md#create) - Create moderation
- [`routerOcr`](docs/sdks/router/README.md#ocr) - Extracts text content while maintaining document structure and hierarchy
- [`routerRerankCreate`](docs/sdks/rerank/README.md#create) - Create rerank
- [`routerResponsesCreate`](docs/sdks/orqresponses/README.md#create) - Create response
- [`routingRulesCreate`](docs/sdks/routingrules/README.md#create) - Create routing rule
- [`routingRulesDelete`](docs/sdks/routingrules/README.md#delete) - Delete routing rule
- [`routingRulesList`](docs/sdks/routingrules/README.md#list) - List routing rules
- [`routingRulesRetrieve`](docs/sdks/routingrules/README.md#retrieve) - Get routing rule
- [`routingRulesUpdate`](docs/sdks/routingrules/README.md#update) - Update routing rule
- [`schedulesCreate`](docs/sdks/schedules/README.md#create) - Create schedule
- [`schedulesDelete`](docs/sdks/schedules/README.md#delete) - Delete schedule
- [`schedulesList`](docs/sdks/schedules/README.md#list) - List schedules
- [`schedulesRetrieve`](docs/sdks/schedules/README.md#retrieve) - Retrieve schedule
- [`schedulesTrigger`](docs/sdks/schedules/README.md#trigger) - Trigger schedule execution
- [`schedulesUpdate`](docs/sdks/schedules/README.md#update) - Update schedule
- [`toolsCreate`](docs/sdks/tools/README.md#create) - Create tool
- [`toolsDelete`](docs/sdks/tools/README.md#delete) - Delete tool
- [`toolsGetV2ToolsToolIdVersions`](docs/sdks/tools/README.md#getv2toolstoolidversions) - List tool versions
- [`toolsGetV2ToolsToolIdVersionsVersionId`](docs/sdks/tools/README.md#getv2toolstoolidversionsversionid) - Get tool version
- [`toolsList`](docs/sdks/tools/README.md#list) - List tools
- [`toolsRetrieve`](docs/sdks/tools/README.md#retrieve) - Retrieve tool
- [`toolsUpdate`](docs/sdks/tools/README.md#update) - Update tool
- ~~[`agentsInvoke`](docs/sdks/agents/README.md#invoke)~~ - Execute an agent task :warning: **Deprecated**
- ~~[`agentsRun`](docs/sdks/agents/README.md#run)~~ - Run an agent with configuration :warning: **Deprecated**
- ~~[`agentsStream`](docs/sdks/agents/README.md#stream)~~ - Stream agent execution in real-time :warning: **Deprecated**
- ~~[`agentsStreamRun`](docs/sdks/agents/README.md#streamrun)~~ - Run agent with streaming response :warning: **Deprecated**
- ~~[`deploymentsMetricsCreate`](docs/sdks/metrics/README.md#create)~~ - Add metrics :warning: **Deprecated**

</details>
<!-- End Standalone functions [standalone-funcs] -->

<!-- Start Server-sent event streaming [eventstream] -->
## Server-sent event streaming

[Server-sent events][mdn-sse] are used to stream content from certain
operations. These operations will expose the stream as an async iterable that
can be consumed using a [`for await...of`][mdn-for-await-of] loop. The loop will
terminate when the server no longer has any events to send and closes the
underlying connection.

```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  environment: "<value>",
  contactId: "<id>",
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.deployments.stream({
    key: "<key>",
    identity: {
      id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      displayName: "Jane Doe",
      email: "jane.doe@example.com",
      metadata: [
        {
          "department": "Engineering",
          "role": "Senior Developer",
        },
      ],
      logoUrl: "https://example.com/avatars/jane-doe.jpg",
      tags: [
        "hr",
        "engineering",
      ],
    },
    documents: [
      {
        text:
          "The refund policy allows customers to return items within 30 days of purchase for a full refund.",
        metadata: {
          fileName: "refund_policy.pdf",
          fileType: "application/pdf",
          pageNumber: 1,
        },
      },
      {
        text: "Premium members receive free shipping on all orders over $50.",
        metadata: {
          fileName: "membership_benefits.md",
          fileType: "text/markdown",
        },
      },
    ],
  });

  for await (const event of result) {
    console.log(event);
  }
}

run();

```

[mdn-sse]: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
[mdn-for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
<!-- End Server-sent event streaming [eventstream] -->

<!-- Start File uploads [file-upload] -->
## File uploads

Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request.

> [!TIP]
>
> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory:
>
> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options).
> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads.
> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `<input type="file">` element.
> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob).

```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.router.audio.transcriptions.create({
    model: "Malibu",
    temperature: 0.5,
    timestampGranularities: [
      "word",
      "segment",
    ],
    retry: {
      onCodes: [
        429,
        500,
        502,
        503,
        504,
      ],
    },
    loadBalancer: {
      type: "weight_based",
      models: [
        {
          model: "openai/gpt-4o",
          weight: 0.7,
        },
      ],
    },
    timeout: {
      callTimeout: 30000,
    },
    orq: {
      fallbacks: [
        {
          model: "openai/gpt-4o-mini",
        },
      ],
      retry: {
        onCodes: [
          429,
          500,
          502,
          503,
          504,
        ],
      },
      identity: {
        id: "contact_01ARZ3NDEKTSV4RRFFQ69G5FAV",
        displayName: "Jane Doe",
        email: "jane.doe@example.com",
        metadata: [
          {
            "department": "Engineering",
            "role": "Senior Developer",
          },
        ],
        logoUrl: "https://example.com/avatars/jane-doe.jpg",
        tags: [
          "hr",
          "engineering",
        ],
      },
      loadBalancer: {
        type: "weight_based",
        models: [
          {
            model: "openai/gpt-4o",
            weight: 0.7,
          },
          {
            model: "anthropic/claude-3-5-sonnet",
            weight: 0.3,
          },
        ],
      },
      timeout: {
        callTimeout: 30000,
      },
    },
  });

  console.log(result);
}

run();

```
<!-- End File uploads [file-upload] -->

<!-- Start Retries [retries] -->
## Retries

Some of the endpoints in this SDK support retries.  If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API.  However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:
```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  await orq.postV2FeedbackEvaluationRemove(undefined, {
    retries: {
      strategy: "backoff",
      backoff: {
        initialInterval: 1,
        maxInterval: 50,
        exponent: 1.1,
        maxElapsedTime: 100,
      },
      retryConnectionErrors: false,
    },
  });
}

run();

```

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:
```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  retryConfig: {
    strategy: "backoff",
    backoff: {
      initialInterval: 1,
      maxInterval: 50,
      exponent: 1.1,
      maxElapsedTime: 100,
    },
    retryConnectionErrors: false,
  },
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  await orq.postV2FeedbackEvaluationRemove();
}

run();

```
<!-- End Retries [retries] -->

<!-- Start Error Handling [errors] -->
## Error Handling

[`OrqError`](./src/models/errors/orqerror.ts) is the base class for all HTTP error responses. It has the following properties:

| Property            | Type       | Description                                                                             |
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
| `error.message`     | `string`   | Error message                                                                           |
| `error.statusCode`  | `number`   | HTTP response status code eg `404`                                                      |
| `error.headers`     | `Headers`  | HTTP response headers                                                                   |
| `error.body`        | `string`   | HTTP body. Can be empty string if no body is returned.                                  |
| `error.rawResponse` | `Response` | Raw HTTP response                                                                       |
| `error.data$`       |            | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |

### Example
```typescript
import { Orq } from "@orq-ai/node";
import * as errors from "@orq-ai/node/models/errors";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  try {
    const result = await orq.feedback.postV2Feedback();

    console.log(result);
  } catch (error) {
    // The base class for HTTP error responses
    if (error instanceof errors.OrqError) {
      console.log(error.message);
      console.log(error.statusCode);
      console.log(error.body);
      console.log(error.headers);

      // Depending on the method different errors may be thrown
      if (error instanceof errors.PostV2FeedbackResponseBody) {
        console.log(error.data$.message); // string
      }
    }
  }
}

run();

```

### Error Classes
**Primary error:**
* [`OrqError`](./src/models/errors/orqerror.ts): The base class for HTTP error responses.

<details><summary>Less common errors (48)</summary>

<br />

**Network errors:**
* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server.
* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal.
* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client.
* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid.
* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error.


**Inherit from [`OrqError`](./src/models/errors/orqerror.ts)**:
* [`HonoApiError`](./src/models/errors/honoapierror.ts): Applicable to 10 of 144 methods.*
* [`PostV2FeedbackResponseBody`](./src/models/errors/postv2feedbackresponsebody.ts): Bad Request. Status code `400`. Applicable to 1 of 144 methods.*
* [`InvokeEvalResponseBody`](./src/models/errors/invokeevalresponsebody.ts): Bad request. Status code `400`. Applicable to 1 of 144 methods.*
* [`PostV2AgentsA2aResponseBody`](./src/models/errors/postv2agentsa2aresponsebody.ts): Invalid request or agent card fetch failed. Status code `400`. Applicable to 1 of 144 methods.*
* [`PostV2AgentsKeyCardRefreshResponseBody`](./src/models/errors/postv2agentskeycardrefreshresponsebody.ts): Invalid request - Agent is not an A2A agent or card fetch failed. Status code `400`. Applicable to 1 of 144 methods.*
* [`CreateAgentScheduleResponseBody`](./src/models/errors/createagentscheduleresponsebody.ts): Invalid schedule type, expression, or sub-hour cadence. Status code `400`. Applicable to 1 of 144 methods.*
* [`UpdateAgentScheduleResponseBody`](./src/models/errors/updateagentscheduleresponsebody.ts): Invalid type, expression, or sub-hour cadence. Status code `400`. Applicable to 1 of 144 methods.*
* [`TriggerAgentScheduleResponseBody`](./src/models/errors/triggeragentscheduleresponsebody.ts): Schedule is inactive. Status code `400`. Applicable to 1 of 144 methods.*
* [`PostV2FeedbackFeedbackResponseBody`](./src/models/errors/postv2feedbackfeedbackresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`PostV2FeedbackRemoveResponseBody`](./src/models/errors/postv2feedbackremoveresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`GetEvalsResponseBody`](./src/models/errors/getevalsresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`CreateEvalResponseBody`](./src/models/errors/createevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdateEvalResponseBody`](./src/models/errors/updateevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`DeleteEvalResponseBody`](./src/models/errors/deleteevalresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`InvokeEvalEvalsResponseBody`](./src/models/errors/invokeevalevalsresponsebody.ts): Workspace ID is not found on the request. Status code `404`. Applicable to 1 of 144 methods.*
* [`GetV2EvaluatorsIdVersionsResponseBody`](./src/models/errors/getv2evaluatorsidversionsresponsebody.ts): Evaluator not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`RetrieveIdentityResponseBody`](./src/models/errors/retrieveidentityresponsebody.ts): Identity not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdateIdentityResponseBody`](./src/models/errors/updateidentityresponsebody.ts): Identity not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`DeleteIdentityResponseBody`](./src/models/errors/deleteidentityresponsebody.ts): Identity not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`PostV2AgentsKeyCardRefreshAgentsResponseBody`](./src/models/errors/postv2agentskeycardrefreshagentsresponsebody.ts): Agent not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`DeleteAgentResponseBody`](./src/models/errors/deleteagentresponsebody.ts): Agent not found. The specified agent key does not exist in the workspace or has already been deleted. Status code `404`. Applicable to 1 of 144 methods.*
* [`RetrieveAgentRequestResponseBody`](./src/models/errors/retrieveagentrequestresponsebody.ts): Agent not found. The specified agent key does not exist in the workspace or you do not have permission to access it. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdateAgentResponseBody`](./src/models/errors/updateagentresponsebody.ts): Agent not found. The specified agent key does not exist in the workspace or you do not have permission to modify it. Status code `404`. Applicable to 1 of 144 methods.*
* [`StreamRunAgentResponseBody`](./src/models/errors/streamrunagentresponsebody.ts): Model not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`StreamAgentResponseBody`](./src/models/errors/streamagentresponsebody.ts): Agent not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdatePromptResponseBody`](./src/models/errors/updatepromptresponsebody.ts): Prompt not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`DeletePromptResponseBody`](./src/models/errors/deletepromptresponsebody.ts): Prompt not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`GetPromptVersionResponseBody`](./src/models/errors/getpromptversionresponsebody.ts): Not Found - The prompt or prompt version does not exist. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdateToolResponseBody`](./src/models/errors/updatetoolresponsebody.ts): Tool not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`GetV2ToolsToolIdVersionsResponseBody`](./src/models/errors/getv2toolstoolidversionsresponsebody.ts): Tool not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`GetV2ToolsToolIdVersionsVersionIdResponseBody`](./src/models/errors/getv2toolstoolidversionsversionidresponsebody.ts): Tool or version not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`CreateAgentScheduleSchedulesResponseBody`](./src/models/errors/createagentscheduleschedulesresponsebody.ts): Agent (or agent version, when agent_tag is set) not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`DeleteAgentScheduleResponseBody`](./src/models/errors/deleteagentscheduleresponsebody.ts): Schedule not found, or belongs to a different agent. Status code `404`. Applicable to 1 of 144 methods.*
* [`RetrieveAgentScheduleResponseBody`](./src/models/errors/retrieveagentscheduleresponsebody.ts): Schedule not found, or belongs to a different agent. Status code `404`. Applicable to 1 of 144 methods.*
* [`UpdateAgentScheduleSchedulesResponseBody`](./src/models/errors/updateagentscheduleschedulesresponsebody.ts): Schedule or agent version not found. Status code `404`. Applicable to 1 of 144 methods.*
* [`TriggerAgentScheduleSchedulesResponseBody`](./src/models/errors/triggeragentscheduleschedulesresponsebody.ts): Schedule not found, or belongs to a different agent. Status code `404`. Applicable to 1 of 144 methods.*
* [`PostV2AgentsA2aAgentsResponseBody`](./src/models/errors/postv2agentsa2aagentsresponsebody.ts): Agent with this key already exists. Status code `409`. Applicable to 1 of 144 methods.*
* [`CreateModerationResponseBody`](./src/models/errors/createmoderationresponsebody.ts): Returns validation error. Status code `422`. Applicable to 1 of 144 methods.*
* [`CreateTranscriptionResponseBody`](./src/models/errors/createtranscriptionresponsebody.ts): Returns validation error. Status code `422`. Applicable to 1 of 144 methods.*
* [`CreateTranslationResponseBody`](./src/models/errors/createtranslationresponsebody.ts): Returns validation error. Status code `422`. Applicable to 1 of 144 methods.*
* [`InvokeEvalEvalsResponseResponseBody`](./src/models/errors/invokeevalevalsresponseresponsebody.ts): Error running the evaluator. Status code `500`. Applicable to 1 of 144 methods.*
* [`RetrieveIdentityIdentitiesResponseBody`](./src/models/errors/retrieveidentityidentitiesresponsebody.ts): Failed to fetch metrics. Status code `500`. Applicable to 1 of 144 methods.*
* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.

</details>

\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
<!-- End Error Handling [errors] -->

<!-- Start Server Selection [server] -->
## Server Selection

### Override Server URL Per-Client

The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example:
```typescript
import { Orq } from "@orq-ai/node";

const orq = new Orq({
  serverURL: "https://my.orq.ai",
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  await orq.postV2FeedbackEvaluationRemove();
}

run();

```
<!-- End Server Selection [server] -->

<!-- Start Custom HTTP Client [http-client] -->
## Custom HTTP Client

The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native
[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This
client is a thin wrapper around `fetch` and provides the ability to attach hooks
around the request lifecycle that can be used to modify the request or handle
errors and response.

The `HTTPClient` constructor takes an optional `fetcher` argument that can be
used to integrate a third-party HTTP client or when writing tests to mock out
the HTTP client and feed in fixtures.

The following example shows how to:
- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
- use the `"beforeRequest"` hook to add a custom header and a timeout to requests
- use the `"requestError"` hook to log errors

```typescript
import { Orq } from "@orq-ai/node";
import { ProxyAgent } from "undici";
import { HTTPClient } from "@orq-ai/node/lib/http";

const dispatcher = new ProxyAgent("http://proxy.example.com:8080");

const httpClient = new HTTPClient({
  // 'fetcher' takes a function that has the same signature as native 'fetch'.
  fetcher: (input, init) =>
    // 'dispatcher' is specific to undici and not part of the standard Fetch API.
    fetch(input, { ...init, dispatcher } as RequestInit),
});

httpClient.addHook("beforeRequest", (request) => {
  const nextRequest = new Request(request, {
    signal: request.signal || AbortSignal.timeout(5000)
  });

  nextRequest.headers.set("x-custom-header", "custom value");

  return nextRequest;
});

httpClient.addHook("requestError", (error, request) => {
  console.group("Request Error");
  console.log("Reason:", `${error}`);
  console.log("Endpoint:", `${request.method} ${request.url}`);
  console.groupEnd();
});

const sdk = new Orq({ httpClient: httpClient });
```
<!-- End Custom HTTP Client [http-client] -->

<!-- Start Debugging [debug] -->
## Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass a logger that matches `console`'s interface as an SDK option.

> [!WARNING]
> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.

```typescript
import { Orq } from "@orq-ai/node";

const sdk = new Orq({ debugLogger: console });
```

You can also enable a default debug logger by setting an environment variable `ORQ_DEBUG` to true.
<!-- End Debugging [debug] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development

## Maturity

This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
looking for the latest version.

## Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. 
We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. 

### SDK Created by [Speakeasy](https://www.speakeasy.com/?utm_source=@orq-ai/node&utm_campaign=typescript)
