Cape API (1.0.0)

Download OpenAPI specification:Download

Welcome to Cape API

Overview

The Cape API keeps sensitive data private while using LLMs like GPT-4 and GPT-3.5 Turbo. With Cape, you can easily de-identify sensitive data before sending it to OpenAI. In addition, you can create embeddings from sensitive text and documents and perform vector searches to improve your prompt context all while keeping the data confidential.

Authorization

All endpoints need to be authorized with an HTTP Bearer token. API keys are to be included in requests as the header Authorization: Bearer <api-key>, e.g,. with a curl request

curl -H "Authorization: Bearer $CAPE_API_KEY" https://api.capeprivacy.com/mykey...

You can generate API keys by visiting the API keys page. See individual endpoints for more detail and examples.

Keys

List Keys

List all of a users keys. Keys are created whenever you upload a document.

SecurityHTTPUser
Request
query Parameters
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
prefix
string (Prefix)

Optional parameter to restrict the returned keys to keys with the given prefix.

Responses
200

Successful Response

404

Not found

422

Validation Error

get/keys
Request samples
Response samples
application/json
{
  • "keys": [
    ]
}

Delete Key

Delete a key. This will also delete any documents that were created under that key.

SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
Responses
200

Successful Response

404

Not found

422

Validation Error

delete/keys/{key}
Request samples
Response samples
application/json
null

Uploads

List all documents under a key

Get a list of documents that exist under a key.

SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
query Parameters
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
Responses
200

Successful Response

422

Validation Error

get/keys/{key}/uploads
Request samples
Response samples
application/json
{
  • "documents": [
    ],
  • "total_count": 1
}

Get Upload

Get an upload by key & id.

You can see your keys with the /keys endpoint, and all uploads under a key with /keys/{key}/uploads.

When requesting an upload, you can use the format query parameter to return the document in either plaintext or redacted form.

SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
id
required
string (Id)
query Parameters
format
string (FormatType)
Default: "plaintext"

Which format to return the results. Possible values are plaintext or redacted.plaintext will return the results as they were uploaded.redacted will return the results with PII removed.

Enum: "plaintext" "redacted"
Responses
200

Successful Response

422

Validation Error

get/keys/{key}/uploads/{id}
Request samples
Response samples
application/json
{
  • "id": "df481aff-93b1-4c09-a030-9dc7d2bb72c9",
  • "filename": "myfile.txt",
  • "content": "Wayne Gretzky was a great hockey player!",
  • "tokens": 11
}

Upload Text

SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
filename
required
string (Filename)
content
required
string (Content)
embeddings_model
string (Embeddings Model)
Default: "all-mpnet-base-v2"
chunk_size
integer (Chunk Size) >= 0
Default: 1000

Maximum size of chunks, in characters, when splitting text using the RecursiveCharacterTextSplitter before uploading to the vector store.

Note that in many common document types, actual chunk sizes will often be smaller than the specified maximum value. This occurs due to the splitter detecting demarcations like paragraph or page breaks, which it uses to create more contextually meaningful chunks.

chunk_overlap
integer (Chunk Overlap) >= 0
Default: 0

Number of overlapping characters between adjacent chunks when splitting text using the RecursiveCharacterTextSplitter before uploading to the vector store.

Responses
200

Successful Response

422

Validation Error

post/keys/{key}/uploads/text
Request samples
application/json
{
  • "filename": "myfile.txt",
  • "content": "hello, world!"
}
Response samples
application/json
{
  • "message": "string",
  • "document": {
    }
}

Upload File

Upload a file for future use in vector search.

The following type of documents are supported:

  • pdf
  • markdown
  • csv
  • docx
  • pptx
  • xlsx
SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

The file to be uploaded as a document

chunk_size
integer (Chunk Size) >= 0
Default: 1000

Maximum size of chunks, in characters, when splitting text using the RecursiveCharacterTextSplitter before uploading to the vector store.

Note that in many common document types, actual chunk sizes will often be smaller than the specified maximum value. This occurs due to the splitter detecting demarcations like paragraph or page breaks, which it uses to create more contextually meaningful chunks.

chunk_overlap
integer (Chunk Overlap) >= 0
Default: 0

Number of overlapping characters between adjacent chunks when splitting text using the RecursiveCharacterTextSplitter before uploading to the vector store.

Responses
200

Successful Response

422

Validation Error

post/keys/{key}/uploads/file
Request samples
Response samples
application/json
{
  • "message": "string",
  • "document": {
    }
}

Privacy

Deidentify Text

Get the de-identified text from a document.

This removes all the personal identifiable information (PII) from the input text. You can optionally specify which entity types should be removed or allowed.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
content
required
string (Content)

The content to deidentify

mask_format
string (Mask Format)
Default: "[MASK]"
Defines a custom format for masking identified entities
during de-identification. This format has to be one of these
"option: [MASK], __MASK__, {MASK}.
For instance, if you set the mask_format to '__MASK__',
identified entities like 'Bob' will be redacted as '__NAME_GIVEN_1__'.
object (Entity Detection)

Tweak what kinds of entities are detected from content

Array of objects (Entities)

Additional entities, you can set this field to consider entity names that are not present in request content.

Responses
200

Successful Response

422

Validation Error

post/privacy/deidentify/text
Request samples
application/json

Redact existing PII entities

{
  • "content": "Hello, Bob!",
  • "entity_detection": {
    }
}
Response samples
application/json
{
  • "content": "Hello, [NAME_GIVEN_1]!",
  • "entities": [
    ]
}

Deidentify File

Get the de-identified text from a file.

This removes all the personal identifiable information (PII) from the input file. You can optionally specify which entity types should be removed or allowed.

SecurityHTTPUser
Request
query Parameters
mask_format
string (Mask Format) \[MASK\]|__MASK__|\{MASK\}
Default: "[MASK]"

Defines a custom format for masking identified entities during de-identification. This format has to be one of these option: [MASK], MASK, {MASK}. For instance, if you set the mask_format to 'MASK', identified entities like 'Bob' will be redacted as 'NAME_GIVEN_1'.

Request Body schema: multipart/form-data
required
file
required
string <binary> (File)
entity_detection
string <json-string> (Entity Detection)

Tweak what kinds of entities are detected from the file

entities
string <json-string> (Entities)

Additional entities, you can set this field to consider entity names that are not present in the file.

Responses
200

Successful Response

422

Validation Error

post/privacy/deidentify/file
Request samples
Response samples
application/json
{
  • "content": "Hello, [NAME_GIVEN_1]!",
  • "entities": [
    ]
}

Reidentify Text

Get the re-identified text from a document.

This repopulates fields of personal identifiable information (PII) that were removed. The fields that are populated are passed in as part of the request.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
content
required
string (Content)

The deidentified text you wish to reidentify. This is usually from the content field of a deidentify call output.

required
Array of objects (Entities)

A list of entities to use while reidentifying. This is usually from the entities field of a deidentify call output.

Responses
200

Successful Response

422

Validation Error

post/privacy/reidentify/text
Request samples
application/json
{
  • "content": "Hello, [NAME_GIVEN_1]!",
  • "entities": [
    ]
}
Response samples
application/json
{
  • "content": "Hello, Johnny!"
}

Reidentify File

Get the re-identified text from a file.

This repopulates fields of personal identifiable information (PII) that were removed. The fields that are populated are passed in as part of the request.

SecurityHTTPUser
Request
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)
entities
required
any (Entities)

A list of entities to use while reidentifying. This is usually from the entities field of a deidentify call output.

Responses
200

Successful Response

422

Validation Error

post/privacy/reidentify/file
Request samples
Response samples
application/json
{
  • "content": "Hello, Johnny!"
}

Chat

Submit a chat completions request to OpenAI.Deprecated

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
object (Openai Request)
Responses
200

Successful Response

422

Validation Error

post/chat/completions
Request samples
application/json
{ }
Response samples
application/json
null

Search

Perform a search under a key using either similarity search or max marginal relevance search.

Similarity search: Returns documents most similar to the query.

Max marginal relevance search: Optimizes for similarity to the query and diversity among selected documents. Ensures that returned documents are not only relevant but also provide diverse information.

When searching, you can use the format query parameter to return the document in either plaintext or redacted form.

This endpoint is similar to the search resolver and can be useful for prototyping or debugging search resolvers.

SecurityHTTPUser
Request
path Parameters
key
required
string (Key)
query Parameters
query
required
string (Query)
nb_chunks
integer (Nb Chunks) >= 1
Default: 4

Number of chunks of documents to return.

retriever_type
string (RetrieverType)
Default: "similarity-search"

Type of retriever to use. Can be either 'similarity-search' or 'max-marginal-relevance-search'.

Enum: "similarity-search" "max-marginal-relevance-search"
format
string (FormatType)
Default: "plaintext"

Which format to return the results. Possible values are plaintext or redacted.plaintext will return the results as they were uploaded.redacted will return the results with PII removed.

Enum: "plaintext" "redacted"
Responses
200

Successful Response

422

Validation Error

get/keys/{key}/search
Request samples
Response samples
application/json
{
  • "chunks": [
    ],
  • "count": 2
}

Anthropic Completions

Submit a completion request to Anthropic Claude

Calls Anthropic's completions endpoint.

To enable auto-redaction pass the format parameter with the value redacted.

To pass additional anthropic parameters use the extra_anthropic field. For example:

{
    "model": "claude-2",
    "prompt": "\n\nHuman: Hello, my name is Bob\n\nAssistant:",
    "format": "redacted",
    "stream": True,
    "max_tokens_to_sample": 500,
    "extra_anthropic": {
        "temperature": 0.5,
    },
}

See Anthropic's API Reference for additional information about the extra parameters that can be passed.

The current supported models are claude-1, claude-2, claude-instant-1.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
model
string (AnthropicModels)
Default: "claude-2"

An enumeration.

Enum: "claude-1" "claude-2" "claude-instant-1"
prompt
required
string (Prompt)
max_tokens_to_sample
required
integer (Max Tokens To Sample)
format
string (FormatType)
Default: "plaintext"

Whether or not to deidentify the request before sending it to anthropic. Deidentified requests will be reidentified before being returned to the caller. Currently, only streamed requests can be deidentified.

Enum: "plaintext" "redacted"
mask_format
string (Mask Format)
Default: "[MASK]"
Defines a custom format for masking identified entities
during de-identification. This format has to be one of these
"option: [MASK], __MASK__, {MASK}.
For instance, if you set the mask_format to '__MASK__',
identified entities like 'Bob' will be redacted as '__NAME_GIVEN_1__'.
return_entities
boolean (Return Entities)
Default: false

Return the entities that were found and redacted when using format: redacted. When using stream, entities will be returned as a stream message after the completion finishes. In practice, this looks like


curl -X 'POST' \
    'http://localhost:8128/v1/anthropic/complete' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer <token> \
    -H 'Content-Type: application/json' \
    -d '{
        "model": "claude-2",
        "prompt": "\n\nHuman: Hello, my name is Bob\n\nAssistant:",
        "format": "redacted",
        "stream": true,
        "return_entities": true,
        "max_tokens_to_sample": 500,
        "extra_anthropic": {
            "temperature": 1
        }
    }'

data: {"completion": " Hello", "stop_reason": null, "model": null}

data: {"completion": " Bob,", "stop_reason": null, "model": null}

data: {"completion": " it", "stop_reason": null, "model": null}

data: {"completion": "'s", "stop_reason": null, "model": null}

data: {"completion": " nice", "stop_reason": null, "model": null}

data: {"completion": " to", "stop_reason": null, "model": null}

data: {"completion": " meet", "stop_reason": null, "model": null}

data: {"completion": " you", "stop_reason": null, "model": null}

data: {"completion": "!", "stop_reason": null, "model": null}

data: {"completion": "", "stop_reason": "stop_sequence", "model": null}

data: {"entities": [{"processed_text": "NAME_GIVEN_1", "text": "Bob", "best_label": "NAME_GIVEN"}]}

data: [DONE]
                                                    
verbose
boolean (Verbose)
Default: false
stream
boolean (Stream)
Default: false
extra_anthropic
object (Extra Anthropic)

Extra parameters that can be passed to the underlying model. See Anthropic's API Reference for more details

return_usage
boolean (Return Usage)
Default: false

When set to true, returns the number of tokens used for prompt, completions and total tokens(prompt + completions) used for the request

curl -X 'POST' \
    'http://localhost:8128/v1/anthropic/complete' \
    -H 'accept: application/json' \
    -H 'Authorization: Bearer <token> \
    -H 'Content-Type: application/json' \
    -d '{
        "model": "claude-2",
        "prompt": "\n\nHuman: Hello, my name is Bob\n\nAssistant:",
        "format": "redacted",
        "stream": true,
        "usage": true,
        "max_tokens_to_sample": 500,
        "extra_anthropic": {
            "temperature": 1
        }
    }'

data: {"completion": " Hello", "stop_reason": null, "model": null}

data: {"completion": " Bob,", "stop_reason": null, "model": null}

data: {"completion": " it", "stop_reason": null, "model": null}

data: {"completion": "'s", "stop_reason": null, "model": null}

data: {"completion": " nice", "stop_reason": null, "model": null}

data: {"completion": " to", "stop_reason": null, "model": null}

data: {"completion": " meet", "stop_reason": null, "model": null}

data: {"completion": " you", "stop_reason": null, "model": null}

data: {"completion": "!", "stop_reason": null, "model": null}

data: {"completion": "", "stop_reason": "stop_sequence", "model": null}

data: {"usage": {"prompt_tokens": 17, "completion_tokens": 15, "total_tokens": 32}}

data: [DONE]
    
object (Policy)
Responses
200

If stream, a stream of json objects otherwise a single json object

422

Validation Error

post/anthropic/complete
Request samples
application/json
{
  • "model": "claude-2",
  • "prompt": "\n\nHuman: Hello, my name is Bob\n\nAssistant:",
  • "format": "redacted",
  • "stream": true,
  • "max_tokens_to_sample": 500,
  • "extra_anthropic": {
    }
}
Response samples
null

Azure OpenAI Completions

Submit a chat completions request to Azure OpenAI.

Submit a chat completions request to Azure OpenAI. Currently only supports the model gpt-4, gpt-4-32k, gpt-35-turbo, gpt-35-turbo-16k.

Uses the same format as the latest version of the OpenAI API's ChatCompletions endpoint, which is documented at https://platform.openai.com/docs/api-reference/chat/create.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
model
required
string (Model)
required
Array of objects (Messages)
functions
Array of objects (Functions)
format
string (FormatType)
Default: "plaintext"

An enumeration.

Enum: "plaintext" "redacted"
mask_format
string (Mask Format)
Default: "[MASK]"
Defines a custom format for masking identified entities
during de-identification. This format has to be one of these
"option: [MASK], __MASK__, {MASK}.
For instance, if you set the mask_format to '__MASK__',
identified entities like 'Bob' will be redacted as '__NAME_GIVEN_1__'.
return_entities
boolean (Return Entities)
Default: false

Return the entities that were found and redacted when using format: redacted. When using stream, entities will be returned as a stream message after the completion finishes.

verbose
boolean (Verbose)
Default: false
stream
boolean (Stream)
Default: false
return_usage
boolean (Return Usage)
Default: false

When set to true, returns the number of tokens used for prompt, completions and total tokens(prompt + completions) used for the request

extra_openai
object (Extra Openai)

Extra parameters that can be passed to the underlying model. See Azure OpenAI's API Reference for more details.

object (Policy)
Responses
200

If stream, a stream of json objects otherwise a single json object

422

Validation Error

post/azure/completions
Request samples
application/json
{
  • "model": "gpt-4-32k",
  • "messages": [
    ],
  • "format": "redacted",
  • "extra_openai": {
    }
}
Response samples
null

OpenAI Completions

Submit a chat completions request to OpenAI.

Submit a chat completions request to OpenAI.

Uses the same format as the latest version of the OpenAI API's ChatCompletions endpoint, which is documented at https://platform.openai.com/docs/api-reference/chat/create.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
model
required
string (Model)
required
Array of objects (Messages)
functions
Array of objects (Functions)
format
string (FormatType)
Default: "plaintext"

An enumeration.

Enum: "plaintext" "redacted"
mask_format
string (Mask Format)
Default: "[MASK]"
Defines a custom format for masking identified entities
during de-identification. This format has to be one of these
"option: [MASK], __MASK__, {MASK}.
For instance, if you set the mask_format to '__MASK__',
identified entities like 'Bob' will be redacted as '__NAME_GIVEN_1__'.
return_entities
boolean (Return Entities)
Default: false

Return the entities that were found and redacted when using format: redacted. When using stream, entities will be returned as a stream message after the completion finishes.

verbose
boolean (Verbose)
Default: false
stream
boolean (Stream)
Default: false
return_usage
boolean (Return Usage)
Default: false

When set to true, returns the number of tokens used for prompt, completions and total tokens(prompt + completions) used for the request

extra_openai
object (Extra Openai)

Extra parameters that can be passed to the underlying model. See OpenAI's API Reference for more details

object (Policy)
Responses
200

If stream, a stream of json objects otherwise a single json object

422

Validation Error

post/openai/chat/completions
Request samples
application/json
{
  • "model": "gpt-4",
  • "messages": [
    ],
  • "format": "redacted",
  • "extra_openai": {
    }
}
Response samples
null

Cohere Completions

Submit a completion request to Cohere chat api

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
message
required
string (Message)
format
string (FormatType)
Default: "plaintext"

An enumeration.

Enum: "plaintext" "redacted"
mask_format
string (Mask Format)
Default: "[MASK]"
Defines a custom format for masking identified entities
during de-identification. This format has to be one of these
"option: [MASK], __MASK__, {MASK}.
For instance, if you set the mask_format to '__MASK__',
identified entities like 'Bob' will be redacted as '__NAME_GIVEN_1__'.
return_entities
boolean (Return Entities)
Default: false
return_usage
boolean (Return Usage)
Default: false

When set to true, returns the number of tokens used for prompt, completions and total tokens(prompt + completions) used for the request

verbose
boolean (Verbose)
Default: false
stream
boolean (Stream)
Default: false
extra_cohere
object (Extra Cohere)

Extra parameters that can be passed to the underlying model.

object (Policy)
Responses
200

If stream, a stream of json objects otherwise a single json object

422

Validation Error

post/cohere/chat
Request samples
application/json
{
  • "message": "Some of the data may be redacted. Please respond with the placeholders as they are, without modification, as they are sufficient for a response. Please do not try to redact information yourself. Please do not change the placeholder format whatsoever. Bob is a software engineer who works at the company Cape Privacy! What company does Bob work for?",
  • "format": "redacted",
  • "stream": true,
  • "extra_cohere": {
    }
}
Response samples
null

Confidential Cape LLMs Completions

Submit a completion request to a Confidential Cape LLM

This route calls a language model hosted by Cape in a secure enclave preserving the confidentiality of the prompt and the output returned by the model.

The current supported model is llama2-7b-chat.

For more information about the llama2 prompt format check out this blog post https://huggingface.co/blog/llama2#how-to-prompt-llama-2.

Returns: A completion generated by the specified language model based on the input prompt and other parameters provided in cape_llm_request.

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
model
string (CapeModels)
Default: "llama2-7b-chat"

The model to use for generating completions.

Value: "llama2-7b-chat"
prompt
required
string (Prompt)

The prompt to generate completions.

max_tokens
integer (Max Tokens)
Default: 16

The maximum number of tokens to generate in the completion.

suffix
string (Suffix)

The suffix that comes after a completion of inserted text.

temperature
number (Temperature) [ 0 .. 2 ]
Default: 0.8

What sampling temperature to use, between 0 and 2.Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.

top_k
integer (Top K) >= 0
Default: 40

Limit the next token selection to the K most probable tokens.

top_p
number (Top P) [ 0 .. 1 ]
Default: 0.95

Limit the next token selection to a subset of tokens with a cumulative probability above a threshold P.

stream
boolean (Stream)
Default: false

Whether to stream the results as they are generated.

Stop (string) or Array of Stop (strings) (Stop)

A list of tokens at which to stop generation. If None, no stop tokens are used.

return_usage
boolean (Return Usage)
Default: false

When set to true, returns the number of tokens used for prompt, completions and total tokens(prompt + completions) used for the request

object (Policy)
Responses
200

Successful Response

422

Validation Error

post/cape/completions
Request samples
application/json

Generate text given a prompt

{
  • "model": "llama2-7b-chat",
  • "prompt": "<|im_start|>system\nYou are a helpful Assistant.<|im_end|>\n<|im_start|>user\nWhat is the Capital of France?<|im_end|>\n<|im_start|>assistant",
  • "max_tokens": 50,
  • "temperature": 0.8,
  • "stream": false
}
Response samples
application/json
null

Confidential OCR (Optical Character Recognition)

Submit a confidential OCR (Optical Character Recognition) request

Submits a PDF for confidential OCR (Optical Character Recognition).

The file submitted is sent to a enclave for secure processing. No one can view the input data or the outputted response.

SecurityHTTPUser
Request
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

The file to do OCR on. Only pdfs are supported.

Responses
200

Successful Response

422

Validation Error

post/ocr
Request samples
Response samples
application/json
{
  • "ocr_records": {
    },
  • "ocr_transcript": "string"
}

Confidential file reader

Submit a confidential reader request. Which extracts text from many different kinds of documents.

Submit a confidential reader request. Which extracts text from many different kinds of documents.

The following type of documents are supported:

  • pdf
  • markdown
  • csv
  • docx
  • pptx
  • xlsx

When the data is cape encrypted it must be in the following JSON format:

{
    "data": "<base64 encoded data to be read>",
    "mimetype": "<the mimetype such as application/pdf>",
    "filename": "<a file name such as test.pdf>"
}

Otherwise it can just be one of the supported filetypes above.

SecurityHTTPUser
Request
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

JSON containing the file to read or a cape encrypted string containing the same JSON. See JSON format in API description.

Responses
200

Successful Response

422

Validation Error

post/reader
Request samples
Response samples
application/json
{
  • "text": "string"
}

Bots

Get all bots

SecurityHTTPUser
Request
query Parameters
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
Responses
200

Successful Response

422

Validation Error

get/bots/
Request samples
Response samples
application/json
null

Create a new bot

SecurityHTTPUser
Request
Request Body schema: application/json
required
name
required
string (Name)
base_model
required
string (Base Model)
system_prompt
required
string (System Prompt)
format
required
string (Format)
temperature
number (Temperature)
Default: 1
data_sources
Array of strings (Data Sources)
Default: []
description
string (Description)
avatar_image_data
string (Avatar Image Data)
Responses
200

Successful Response

422

Validation Error

post/bots/
Request samples
application/json
{
  • "name": "my-bot",
  • "base_model": "gpt-4",
  • "format": "plaintext",
  • "system_prompt": "respond like super mario",
  • "description": "Super Mario in your computer!"
}
Response samples
application/json
{
  • "id": "string",
  • "user_id": "string",
  • "name": "string",
  • "avatar_url": "string",
  • "base_model": "string",
  • "system_prompt": "string",
  • "format": "string",
  • "data_sources": [ ],
  • "description": "string",
  • "temperature": 0,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

Describe a bot

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
200

Successful Response

422

Validation Error

get/bots/{id}
Request samples
Response samples
application/json
null

Delete a bot

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
204

Successful Response

422

Validation Error

delete/bots/{id}
Request samples
Response samples
application/json
{
  • "detail": [
    ]
}

Update a bot

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Request Body schema: application/json
required
name
string (Name)
base_model
string (Base Model)
system_prompt
string (System Prompt)
format
string (Format)
temperature
number (Temperature) >= 0
data_sources
Array of strings (Data Sources)
Default: []
description
string (Description)
avatar_image_data
string (Avatar Image Data)
Responses
200

Successful Response

422

Validation Error

patch/bots/{id}
Request samples
application/json
{
  • "name": "my-bot",
  • "base_model": "gpt-4",
  • "format": "plaintext",
  • "system_prompt": "respond like super mario"
}
Response samples
application/json
null

Use a bot

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Request Body schema: application/json
required
required
Array of objects (Messages)
Responses
200

Successful Response

422

Validation Error

post/bots/{id}/completion
Request samples
application/json
{
  • "messages": [
    ]
}
Response samples
application/json
null

Get a bots avatar image

SecurityHTTPUser
Request
path Parameters
bot_id
required
string (Bot Id)
id
required
string (Id)
Responses
200

Successful Response

422

Validation Error

get/bots/avatar/{bot_id}/{id}
Request samples
Response samples
application/json
null

Create an avatar image

Request
Request Body schema: application/json
required
name
required
string (Name)
description
string (Description)
Responses
200

Successful Response

422

Validation Error

post/bots/avatar
Request samples
application/json
{
  • "name": "string",
  • "description": "string"
}
Response samples
application/json
null

Actions

List Actions

List actions

SecurityHTTPUser
Request
query Parameters
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
Responses
200

Successful Response

422

Validation Error

get/actions/
Request samples
Response samples
application/json
null

Add an action to be re-run later

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
function_id
string (Function Id)
function_name
required
string (Function Name)
name
required
string (Name)
description
required
string (Description)
arguments
string <json-string> (Arguments)
Responses
200

Successful Response

422

Validation Error

post/actions/
Request samples
application/json
{
  • "function_id": "fn-7nF8YmLKJB4bHJE2QisNV4",
  • "function_name": "get_sql_data",
  • "name": "get my friends",
  • "description": "function to list my friends",
  • "arguments": "{\"query\": \"select * from friends\"}"
}
Response samples
application/json
null

Get Action

Get an action

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
200

Successful Response

422

Validation Error

get/actions/{id}
Request samples
Response samples
application/json
null

Run Action

Run an action

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
200

Successful Response

422

Validation Error

post/actions/{id}
Request samples
Response samples
application/json
null

Delete Action

Delete an action

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
204

Successful Response

422

Validation Error

delete/actions/{id}
Request samples
Response samples
application/json
{
  • "detail": [
    ]
}

Functions

Retreive list of functions

Lists the available functions filtered by integration_type if provided

Request
query Parameters
integration_types
Array of strings (Integration Types)
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
Responses
200

Successful Response

404

Not found

422

Validation Error

get/functions
Request samples
Response samples
application/json
null

Execute a function

Calls the requested function with the specified arguments if it exists and the user has a valid connector.

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Request Body schema: application/json
required
arguments
required
object (Arguments)
Responses
200

Successful Response

404

Not found

422

Validation Error

post/functions/{id}
Request samples
application/json
{
  • "arguments": { }
}
Response samples
application/json
null

Connectors

List Connectors

List connectors

SecurityHTTPUser
Request
query Parameters
limit
integer (Limit) [ 0 .. 50 ]
Default: 20
offset
integer (Offset) >= 0
Default: 0
Responses
200

Successful Response

422

Validation Error

get/connectors/
Request samples
Response samples
application/json
null

Add Connector

SecurityHTTPUser
Request
header Parameters
content-type
string (Content-Type)
Default: application/json
Request Body schema: application/json
required
integration_type
required
string (Connector)

An enumeration.

Enum: "gmail" "jira" "mssql" "salesforce"
auth_type
string (AuthType)

An enumeration.

Enum: "token" "oauth"
Token (string) or JiraToken (object) (Token)
ask_confirmation
boolean (Ask Confirmation)
Default: false
Responses
200

Successful Response

422

Validation Error

post/connectors/
Request samples
application/json
{
  • "integration_type": "gmail",
  • "auth_type": "token",
  • "token": "<API TOKEN>",
  • "ask_confirmation": true
}
Response samples
application/json
null

Get Connector

Get a connector

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
200

Successful Response

422

Validation Error

get/connectors/{id}
Request samples
Response samples
application/json
null

Delete Connector

Delete a connector

SecurityHTTPUser
Request
path Parameters
id
required
string (Id)
Responses
204

Successful Response

422

Validation Error

delete/connectors/{id}
Request samples
Response samples
application/json
{
  • "detail": [
    ]
}