API Documentation

Chat API
Stories API

Introduction

Welcome to the Deep Realms API documentation! You can find your API key on the profile page.

This page contains the documentation for the Chat API. If you would like to check out the Stories API, please click here.

If you would like to purchase over $300 worth of extra credits as a company, please reach out to us at contact@deeprealms.io and we will provide you with a discount.

Overview

Our Chat API is modeled after OpenAI's API, so that you may use it as a drop-in replacement. We provide lower prices than OpenAI, with an additional option to enhance the quality of the model's output, improving it beyond the standard response you might receive via OpenAI's API. This does not work for all kinds of prompts - it will work best with conversational prompts or prompts that involve storytelling. However, there might be other use cases we simply haven't explored.

We do not yet have all of the functionality of OpenAI's API as of now, but the core functionality is already implemented and we will be adding more over time.

Model prices

* the table below displays prices in USD for various subscription tiers and credit packs.

** Using enhanced outputs (setting the "enhance_output" parameter to true) will increase the price per token by 10%.

Model name Price per 1000 input tokens Price per 1000 output tokens Context size Description
ChatGPT 1.0 $0.0008 / 2 credits $0.0016 / 4 credits 8,192 tokens OpenAI's old ChatGPT model, which is the least censored.
ChatGPT 2.0 $0.0008 / 2 credits $0.0016 / 4 credits 8,192 tokens OpenAI's newer model, which is more censored.
ChatGPT 3.0 $0.0004 / 1 credits $0.0016 / 4 credits 8,192 tokens OpenAI's latest ChatGPT model, which is likely the most censored.
GPT-4 $0.008 / 20 credits $0.024 / 60 credits 8,192 tokens OpenAI's most powerful model.
Freya 4.0 $0.0002 / 0.5 credits $0.0004 / 1 credits 8,192 tokens Our fastest model.
Astral 1.0 $0.0004 / 1 credits $0.0008 / 2 credits 8,192 tokens A cheap, fast and powerful model.
Astral 2.0 $0.0016 / 4 credits $0.0032 / 8 credits 8,192 tokens Our second most powerful alternative model.
Astral 3.0 $0.0048 / 12 credits $0.0096 / 24 credits 8,192 tokens Our most powerful alternative model.
Model name Price per 1000 input tokens Price per 1000 output tokens Context size Description
ChatGPT 1.0 $0.00075 / 2 credits $0.0015 / 4 credits 8,192 tokens OpenAI's old ChatGPT model, which is the least censored.
ChatGPT 2.0 $0.00075 / 2 credits $0.0015 / 4 credits 8,192 tokens OpenAI's newer model, which is more censored.
ChatGPT 3.0 $0.000375 / 1 credits $0.0015 / 4 credits 8,192 tokens OpenAI's latest ChatGPT model, which is likely the most censored.
GPT-4 $0.0075 / 20 credits $0.0225 / 60 credits 8,192 tokens OpenAI's most powerful model.
Freya 4.0 $0.000188 / 0.5 credits $0.000375 / 1 credits 8,192 tokens Our fastest model.
Astral 1.0 $0.000375 / 1 credits $0.00075 / 2 credits 8,192 tokens A cheap, fast and powerful model.
Astral 2.0 $0.0015 / 4 credits $0.003 / 8 credits 8,192 tokens Our second most powerful alternative model.
Astral 3.0 $0.0045 / 12 credits $0.009 / 24 credits 8,192 tokens Our most powerful alternative model.
Model name Price per 1000 input tokens Price per 1000 output tokens Context size Description
ChatGPT 1.0 $0.000625 / 2 credits $0.00125 / 4 credits 8,192 tokens OpenAI's old ChatGPT model, which is the least censored.
ChatGPT 2.0 $0.000625 / 2 credits $0.00125 / 4 credits 8,192 tokens OpenAI's newer model, which is more censored.
ChatGPT 3.0 $0.000312 / 1 credits $0.00125 / 4 credits 8,192 tokens OpenAI's latest ChatGPT model, which is likely the most censored.
GPT-4 $0.00625 / 20 credits $0.01875 / 60 credits 8,192 tokens OpenAI's most powerful model.
Freya 4.0 $0.000156 / 0.5 credits $0.000312 / 1 credits 8,192 tokens Our fastest model.
Astral 1.0 $0.000312 / 1 credits $0.000625 / 2 credits 8,192 tokens A cheap, fast and powerful model.
Astral 2.0 $0.00125 / 4 credits $0.0025 / 8 credits 8,192 tokens Our second most powerful alternative model.
Astral 3.0 $0.00375 / 12 credits $0.0075 / 24 credits 8,192 tokens Our most powerful alternative model.
Model name Price per 1000 input tokens Price per 1000 output tokens Context size Description
ChatGPT 1.0 $0.0005 / 2 credits $0.001 / 4 credits 8,192 tokens OpenAI's old ChatGPT model, which is the least censored.
ChatGPT 2.0 $0.0005 / 2 credits $0.001 / 4 credits 8,192 tokens OpenAI's newer model, which is more censored.
ChatGPT 3.0 $0.00025 / 1 credits $0.001 / 4 credits 8,192 tokens OpenAI's latest ChatGPT model, which is likely the most censored.
GPT-4 $0.005 / 20 credits $0.015 / 60 credits 8,192 tokens OpenAI's most powerful model.
Freya 4.0 $0.000125 / 0.5 credits $0.00025 / 1 credits 8,192 tokens Our fastest model.
Astral 1.0 $0.00025 / 1 credits $0.0005 / 2 credits 8,192 tokens A cheap, fast and powerful model.
Astral 2.0 $0.001 / 4 credits $0.002 / 8 credits 8,192 tokens Our second most powerful alternative model.
Astral 3.0 $0.003 / 12 credits $0.006 / 24 credits 8,192 tokens Our most powerful alternative model.

Index

1. Chat

1.1 /api/v1/chat/completions

1.2 /api/v1/models

Chat Completion

Post https://www.deeprealms.io/api/v1/chat/completions

Create a model response for a given chat conversation.

Request body:

model string (required)

The name of the model to use. You can retrieve a list of available models via the "api/v1/models" endpoint.

messages array (required)

A list of messages comprising the conversation so far.

temperature number or null (optional)

The sampling temperature that should be used. The default value is: 1.

max_tokens integer or null (optional)

The maximum number of tokens that should be generated in a chat completion. This parameter cannot be set if "enhance_output" is set to true. The default value is: null.

stream boolean (optional)

Whether to stream back partial progress. If set to true, tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message. Otherwise, the server will hold the request open until the timeout or until completion, with the response containing the full result as JSON. The default value is: false.

enhance_output boolean (optional)

If set to true, the model output will generally be of higher quality, but it will take a longer time to generate a response.

Example request:

curl -X Post https://www.deeprealms.io/api/v1/chat/completions \
-H "Authorization: Bearer $DEEP_REALMS_API_KEY" \
-d '{
  "model": "ChatGPT 2.0",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Hello!"
    }
  ],
  "temperature": 0.7,
  "max_tokens": 50,
  "stream": false,
  "enhance_output": true
}'

Example response:

{
  "id": null,
  "object": "chat.completion",
  "created": 1677868242,
  "model": "ChatGPT 2.0",
  "usage": {
    "prompt_tokens": 13,
    "completion_tokens": 7,
    "total_tokens": 20
  },
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "\n\nThis is a test!"
      },
      "logprobs": null,
      "finish_reason": "stop",
      "index": 0
    }
  ]
}

Models

GET https://www.deeprealms.io/api/v1/models

Get a list of available models.

Example request:

curl -X GET https://www.deeprealms.io/api/v1/models \
-H "Authorization: Bearer $DEEP_REALMS_API_KEY"

Example response:

{
  "object": "list",
  "data": [
    {
      "id": "ChatGPT 2.0",
      "object": "model"
    },
    {
      "id": "ChatGPT 3.0",
      "object": "model"
    },
    {
      "id": "GPT-4",
      "object": "model"
    },
    {
      "id": "Freya 4.0",
      "object": "model"
    },
    {
      "id": "Magni 2.0",
      "object": "model"
    }
  ]
}