Public Endpoints

Inference

SecurityBearerAuth
Request
Request Body schema: application/json
required
text
required
Array of strings (Text)
model
string (ModelNamespace)
Default: "mosaicml/mpt-7b-instruct"

Provide a namespace to our supported models.

Enum: "meta-llama/Llama-2-13b-chat-hf" "mosaicml/mpt-7b-instruct" "openai/gpt-3.5-turbo" "openai/gpt-3.5-turbo-16k" "openai/gpt-4" "openai/gpt-4-32k"
bucket
string (Bucket)
openai_api_key
string (Openai Api Key)
max_tokens
integer (Max Tokens)
Default: 128
temperature
number (Temperature)
Default: 0.9
Responses
200

Successful Response

Response Schema: application/json
required
object (InferenceResponse)
answer
required
Array of strings (Answer)
422

Validation Error

Response Schema: application/json
Array of objects (Detail)
Array
required
Array of strings or integers (Location)
msg
required
string (Message)
type
required
string (Error Type)
post/ai/generate
Request samples
application/json
{
  • "text": [
    • "string"
    ],
  • "model": "mosaicml/mpt-7b-instruct",
  • "bucket": "string",
  • "openai_api_key": "string",
  • "max_tokens": 128,
  • "temperature": 0.9
}
Response samples
application/json
{
  • "data": {
    • "answer": [
      • "string"
      ]
    }
}

Summary

SecurityBearerAuth
Request
Request Body schema: application/json
required
bucket
required
string (Bucket)
filename
string (Filename)
Responses
200

Successful Response

Response Schema: application/json
required
object (SummaryResponse)
summary
required
string (Summary)
422

Validation Error

Response Schema: application/json
Array of objects (Detail)
Array
required
Array of strings or integers (Location)
msg
required
string (Message)
type
required
string (Error Type)
post/ai/summarize
Request samples
application/json
{
  • "bucket": "string",
  • "filename": "string"
}
Response samples
application/json
{
  • "data": {
    • "summary": "string"
    }
}

Embedding Buckets

Get all embedding buckets for a user.

SecurityBearerAuth
Responses
200

Successful Response

Response Schema: application/json
any
422

Validation Error

Response Schema: application/json
Array of objects (Detail)
Array
required
Array of strings or integers (Location)
msg
required
string (Message)
type
required
string (Error Type)
get/ai/embeddings/buckets
Request samples
Response samples
application/json
null

Embedding

Perform embedding on a Telnyx Storage Bucket using the a embedding model. The current supported file types are:

  • PDF
  • HTML
  • txt/unstructured text files
  • json
  • csv
  • audio / video (mp3, mp4, mpeg, mpga, m4a, wav, or webm ) - Max of 20mb file size.

Any files not matching the above types will be attempted to be embedded as unstructured text.

This process can be slow, so it runs in the background and the user can check the status of the task using the endpoint /embedding/{task_id}.

SecurityBearerAuth
Request
Request Body schema: application/json
required
bucket_name
required
string (Bucket Name)
document_chunk_size
integer (Document Chunk Size)
Default: 1024
document_chunk_overlap_size
integer (Document Chunk Overlap Size)
Default: 512
embedding_model
string (SupportedEmbeddingModels)
Default: "thenlper/gte-large"

An enumeration.

Enum: "thenlper/gte-large" "sentence-transformers/all-mpnet-base-v2"
Responses
200

Successful Response

Response Schema: application/json
any
422

Validation Error

Response Schema: application/json
Array of objects (Detail)
Array
required
Array of strings or integers (Location)
msg
required
string (Message)
type
required
string (Error Type)
post/ai/embeddings
Request samples
application/json
{
  • "bucket_name": "string",
  • "document_chunk_size": 1024,
  • "document_chunk_overlap_size": 512,
  • "embedding_model": "thenlper/gte-large"
}
Response samples
application/json
null

Embedding Task

SecurityBearerAuth
Request
path Parameters
task_id
required
string (Task Id)
Responses
200

Successful Response

Response Schema: application/json
any
422

Validation Error

Response Schema: application/json
Array of objects (Detail)
Array
required
Array of strings or integers (Location)
msg
required
string (Message)
type
required
string (Error Type)
get/ai/embeddings/{task_id}
Request samples
Response samples
application/json
null