Skip to content

API Reference

One endpoint to run them all 💯

Run Integral

POST /api/v1/inference/request

Runs an Integral passing it input and expecting an output

Input Parameters

ParameterTypeDescriptionRequiredDefault
apiIdstringThe id of the Integral being usedYes
messagesMessage[]An array of messages to send to the apiYes
threadIdstring, undefinedWhen passed, the message will be run on the provided thread. if no threadId is provided, each request will create a new thread and return its idNoundefined
replyWiththread, messageSpecifies how much data to return in reply. if no replyWith is provided, it defaults to message. Setting it to thread returns the entire conversation on the thread.Nomessage

Message:

ParameterTypeDescriptionRequiredDefault
roleuser, assitantThe role of the assumed sender of the message. Generally, this will be set to user for requests you initiateYes
contentstringThe text content to send to the API. this can be JSON or in the form of a prompt. it Should contain function parametersYes

Example Request

json
{
  "apiId": "api_ksodf&s382js",
  "messages": [{ "role": "user", "content": "get the weather in Berlin" }],
  "replyWith": "message"
}

Output Parameters

ParameterTypeDescription
idstringThe Integral id
threadIdstringId of the thread on whicht he request was run
messagesMessageObject of the message returned

Message:

ParameterTypeDescription
idstring, undefinedId of the message
roleuser, assitantThe role of the assumed sender of the message. Will be assistant if replyWith is set to message
contentContent[]List of contents returned by the call

Content:

ParameterTypeDescription
typetextThe type of the content. Expected to be text in this version
textstringThe actual message returned. Will be JSON string if responseFormat is set to JSON

Example Response

json
{
  "id": "dsIW3JaX_J_LwwQ2pURlT",
  "threadId": "thread_6zY61bNiZX08Yt15MVolgaue",
  "messages": {
    "id": "msg_54vENtcnHHojV8sBL7HkB7ol",
    "role": "assistant",
    "content": [
      {
        "type": "text",
        "text": "{\"value\":23,\"unit\":\"celcius\"}"
      }
    ]
  }
}