Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ottic.ai/llms.txt

Use this file to discover all available pages before exploring further.

Setup

To start using Ottic, install the SDK as follows:
1

Install Ottic

Install the Ottic Node.js SDK.
npm install ottic
2

Copy your Ottic API key

Visit the Integrations page to obtain your Ottic API key.
This API key is required to enable published prompts in your application.
3

Use a published prompt in production

The following snippet demonstrates how to use a tested and published prompt in your application:
const ottic = new OtticAI({ apiKey: OTTIC_API_KEY });
const livePrompt = await ottic.prompts.render(promptId, {
  variable: "dataset variable",
  variable1: "dataset variable1",
  variable2: "dataset variable2",
});
This code will return a prompt with placeholders replaced by the provided values. If any variables are missing, they will remain as placeholders.To retrieve a prompt with all placeholders intact, use the following code:
const ottic = new OtticAI({ apiKey: OTTIC_API_KEY });
const livePrompt = await ottic.prompts.render(promptId);
This will return the prompt as-is, without any replacements.