Skip to main content
The Orchata TypeScript SDK provides a type-safe, universal client for Node.js, Deno, Bun, and browsers. Get started in under 5 minutes.

Installation

Install the SDK using your preferred package manager:
npm install @orchata-ai/sdk

Get Your API Key

1

Navigate to Dashboard

Go to app.orchata.ai and sign in.
2

Create API Key

Navigate to SettingsAPI Keys and click Create API Key.
3

Copy Your Key

Copy the API key immediately - you won’t be able to see it again after closing the dialog.
Store your API key securely. Never commit it to version control.

Basic Setup

Create a client instance with your API key:
import { Orchata } from '@orchata-ai/sdk';

const client = new Orchata({
  apiKey: 'oai_your_api_key' // Get one at https://app.orchata.ai
});

Your First Query

Query your knowledge base using semantic search:
const { results } = await client.query({
  spaceIds: 'space_123', // Replace with your space ID
  query: 'How do I reset my password?'
});

// Access the first result
console.log(results[0].chunk.content);
console.log(`Similarity score: ${results[0].similarity}`);
{
  "results": [
    {
      "similarity": 0.92,
      "chunk": {
        "content": "To reset your password, go to Settings → Security → Reset Password...",
        "metadata": {}
      },
      "document": {
        "id": "doc_xyz789",
        "filename": "user-guide.md",
        "spaceId": "space_123"
      },
      "space": {
        "id": "space_123",
        "name": "Product Documentation"
      }
    }
  ]
}

Features

Type-Safe

Full TypeScript support with auto-completion and type checking.

Universal

Works with Node.js 18+, Deno, Bun, and modern browsers.

Zero Dependencies

Uses native fetch - no heavy dependencies.

AI-Ready

Built-in tools for Vercel AI SDK v5+ integration.

Next Steps