API Reference (V1)

Updated on September 27, 2023

The Mirage API lets you process AI inference tasks on-demand.

While integrating the REST API, you may be interested in the following guides:


Transcribein Tasks

Get Transcribe Languages

GET
/v1/task/transcribe/languages

List all languages that are available for transcription.

Response Data
reason
string
data
object
languages
object

Map of supported locale codes

  • GEThttps://api.mirage-ai.com/v1/task/transcribe/languages
HTTP
Request
(loading)
Response
(loading)

Transcribe Speech

POST
/v1/task/transcribe/speech{?stream}

Transcribe speech from an audio file to text.

URI Parameters
stream
stringOptional

Can be set to stream the response using SSE

Request Body
locale
objectRequired

Locales to transcribe between

to
stringRequired

Locale code to transcribe to

media
objectRequired

Media file to transcribe

type
stringRequired

Media file MIME type

url
stringRequired

URL of the audio file to be transcribed

  • POSThttps://api.mirage-ai.com/v1/task/transcribe/speech
HTTP
Request
(loading)
Response
(loading)

Answerin Tasks

Answer Question

POST
/v1/task/answer/question{?stream}

Answer a given question.

URI Parameters
stream
stringOptional

Can be set to stream the response using SSE

Request Body
question
stringRequired

Question to generate an answer against

answer
objectOptional

Answer prefill data

start
stringOptional

Start of answer text (answer text prefix)

locale
objectOptional

Locales to answer between

from
stringRequired

Locale code to answer from

context
objectRequired

Context data used to enrich answering

team
objectRequired

Team details

id
stringRequired

Team identifier

name
stringRequired

Team name

transcripts
objectRequired

Transcripts of current and past conversations

conversation
objectRequired

Curent conversation

messages
array[object]Required

List of messages for conversation

from
enum[string]Required

Message sender

Values

  • customer
  • agent
text
stringRequired

Message text

related
array[object]Optional

Related conversations from the past (supersedes dynamic context)

messages
array[object]Required

List of messages for conversation

from
enum[string]Required

Message sender

Values

  • customer
  • agent
text
stringRequired

Message text

  • POSThttps://api.mirage-ai.com/v1/task/answer/question
HTTP
Request
(loading)
Response
(loading)

Summarizein Tasks

Summarize Paragraphs

POST
/v1/task/summarize/paragraphs

Summarize given paragraphs.

Request Body
transcript
array[object]Required

List of paragraphs to summarize

text
stringRequired

Paragraph text

  • POSThttps://api.mirage-ai.com/v1/task/summarize/paragraphs
HTTP
Request
(loading)
Response
(loading)

Summarize Conversation

POST
/v1/task/summarize/conversation

Summarize a given conversation, from a list of messages.

Request Body
transcript
array[object]Required

Transcript of conversation to summarize

name
stringRequired

Message sender name

text
stringRequired

Message text

  • POSThttps://api.mirage-ai.com/v1/task/summarize/conversation
HTTP
Request
(loading)
Response
(loading)

Categorizein Tasks

Categorize Conversation

POST
/v1/task/categorize/conversation

Categorize a given conversation, from a list of messages.

Request Body
transcript
array[object]Required

Transcript of conversation to categorize

from
enum[string]Required

Message sender

Values

  • customer
  • agent
text
stringRequired

Message text

  • POSThttps://api.mirage-ai.com/v1/task/categorize/conversation
HTTP
Request
(loading)
Response
(loading)

Translatein Tasks

Get Translate Languages

GET
/v1/task/translate/languages

List all languages that are available for translation.

Response Data
reason
string
data
object
languages
object

Map of supported locale codes

  • GEThttps://api.mirage-ai.com/v1/task/translate/languages
HTTP
Request
(loading)
Response
(loading)

Translate Text

POST
/v1/task/translate/text

Translate a provided text between two languages.

💡 Note that it is possible to ignore translation for certain parts of the text, by enclosing the text to keep pristine in a <span translate="no"></span> tag. If using such do-not-translate tags, it is required that the type marker is set to html.

Request Body
locale
objectRequired

Locales to translate between

from
stringRequired

Locale code to translate from

to
stringRequired

Locale code to translate to

type
enum[string]Optional

Type of content to translate

Values

  • plain
  • html
text
stringRequired

Text to translate

  • POSThttps://api.mirage-ai.com/v1/task/translate/text
HTTP
Request
(loading)
Response
(loading)

Contextin Data

Ingest Context Data

POST
/v1/data/context/ingest

Ingest context data into account. This will be used eg. when answering a question.

Request Body
items
array[object]Required

Items to be ingested

operation
enum[string]Optional

Item operation (defaults to index)

Values

  • index
  • reindex
  • delete
primary_id
stringRequired

Primary identifier for the item

secondary_id
stringOptional

Secondary identifier for the item

tertiary_id
stringOptional

Tertiary identifier for the item

text
stringOptional

Text content for the item

timestamp
numberOptional

Timestamp for the item (UNIX format, in milliseconds)

source
stringOptional

Source tag for the item (eg. chat)

metadata
objectOptional

Optional metadata to store alongside the item

  • POSThttps://api.mirage-ai.com/v1/data/context/ingest
HTTP
Request
(loading)
Response
(loading)