Skip to Content
PurAI is SHUT DOWN. This website is purely for archival purposes. No such services exist anymore.
DocsGetting Started

Getting Started

Obtaining an API key

Every request to PurAI is authenticated with an API key. To create one:

  1. Create a PurAI account and open your account dashboard

  2. Navigate to the API Keys section

  3. Select Create key

  4. Your key is displayed once. Store it securely, and never share it or commit it to source control.

Making your first request

You interact with PurAI through standard HTTP POST requests — from cURL, fetch(), or any HTTP client — which makes it easy to use from any platform or language.

A simple demonstration using the chat/completions endpoint is below:

More info on our packages, PurAI.js and PurAI.py, can be found in our packages page!
index.js
const PurAI = require('PurAI.js'); const { OpenAIChatCompletionsMessageRole, OpenAIChatCompletionsModel } = require('PurAI.js/src/types'); const PurAI = new PurAI('YOUR API KEY'); let response = await PurAI.openAI.chat.completions({ messages: [ { role: OpenAIChatCompletionsMessageRole.User, content: 'Hello, PurAI!' } ], model: OpenAIChatCompletionsModel['GPT-3.5 Turbo'] // ANY DESIRED MODEL }); console.log(response);

Returns:

Console
{ "id": "chatcmpl-7aW8BDCAXErPoazm2dSI1EKEUzKBQ", "object": "chat.completion", "created": 1688937675, "model": "gpt-3.5-turbo-0613", "choices": [{ "index": 0, "message": { "role": "assistant", "content": "Hello! How can I assist you today?" }, "finish_reason": "stop" }], "usage": { "prompt_tokens": 13, "completion_tokens": 9, "total_tokens": 22 } }

How PurAI is structured

PurAI is simple: you send a POST request to a URL that combines your desired company (openai, for example) and product (chat/completions, for example), and receive the model’s output in response.

The full list of URLs, along with their descriptions, is documented in the following sections.

Last updated on