Skip to main content
POST
/
chat
/
completions
Chat Completion
curl --request POST \
  --url https://api.animusai.co/v2/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "content": "You are having a conversation with a friend.",
      "role": "system"
    },
    {
      "content": "Hey, what have you been up to?",
      "role": "user"
    }
  ],
  "temperature": 1,
  "top_p": 1,
  "n": 1,
  "max_tokens": 150,
  "stop": [
    "<|im_end|>"
  ],
  "stream": false,
  "presence_penalty": 1,
  "frequency_penalty": 1,
  "best_of": 1,
  "top_k": 40,
  "repetition_penalty": 1,
  "min_p": 0,
  "length_penalty": 1,
  "compliance": true,
  "model": "animuslabs/Vivian-llama3.1-70b-1.0-fp8",
  "reasoning": false,
  "check_image_generation": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "<string>",
        "description": "<string>",
        "parameters": {}
      }
    }
  ],
  "tool_choice": "none",
  "autoTurn": false
}'
{
  "id": "<string>",
  "object": "<string>",
  "created": 123,
  "model": "<string>",
  "choices": [
    {
      "index": 123,
      "message": {
        "role": "<string>",
        "content": "<string>",
        "reasoning": "<string>",
        "image_prompt": "<string>",
        "tool_calls": [
          {
            "id": "<string>",
            "type": "function",
            "function": {
              "name": "<string>",
              "arguments": "<string>"
            }
          }
        ],
        "turns": [
          "<string>"
        ],
        "next": true
      },
      "finish_reason": "<string>",
      "compliance_violations": [
        "pedophilia"
      ]
    }
  ],
  "usage": {
    "prompt_tokens": 123,
    "completion_tokens": 123,
    "total_tokens": 123
  },
  "compliance_violations": [
    "drug_use"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
messages
object[]
required

A chronological list of messages that compose the current conversation.

temperature
number
default:1

Adjusts randomness in the response generation, with lower values yielding more predictable responses.

top_p
number
default:1

Filters the token set to those with cumulative probability above this threshold, influencing diversity.

n
integer
default:1

Number of alternate responses to generate.

max_tokens
integer
default:150

Caps the number of tokens in the generated response. Lacks a default to allow model-specific limits.

stop
string[]

A set of strings which, when generated, signal the model to cease response generation.

stream
boolean
default:false

If set to true, the response is streamed back to the client as it's being generated.

presence_penalty
number
default:1

Adjusts likelihood of new words based on their existing presence in the text. Discourages repetition when positive.

frequency_penalty
number
default:1

Penalizes words based on their frequency in the document to encourage diversity.

best_of
integer
default:1

Generates several completions server-side and returns the best. The definition of "best" depends on model and settings.

top_k
integer
default:40

Limits consideration to the top k tokens, diversifying outputs by reducing predictability.

repetition_penalty
number
default:1

Modifies likelihood of repeating tokens based on their previous occurrence, counteracting model's repetition tendency.

min_p
number
default:0

Sets a minimum probability threshold for tokens to be considered for generation, further filtering the possible outputs.

length_penalty
number
default:1

Adjusts the impact of sequence length on selection, encouraging shorter or longer responses.

compliance
boolean
default:true

When true, verifies if the response contains any violations such as inappropriate content.

model
string

The model to use for generating the response.

Example:

"animuslabs/Vivian-llama3.1-70b-1.0-fp8"

reasoning
boolean
default:false

When true, enables reasoning/thinking content from the model. For non-streaming responses, adds a reasoning field. For streaming, thinking content appears in the stream.

check_image_generation
boolean
default:false

⚠️ ALPHA FEATURE: When true, the AI analyzes its response and creates an image_prompt field if an image is requested or desired. This feature is in alpha state and not recommended for production use.

tools
object[]

A list of tools the model may call. Currently, only functions are supported as a tool.

tool_choice
default:auto

Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools.

Available options:
none,
auto
autoTurn
boolean
default:false

When true, splits the API response into individual conversational turns returned as an array called 'turns'.

Response

200 - application/json

The generated response along with relevant metadata.

id
string
required

Unique identifier for the chat completion provided by the system.

object
string
required

Type indicator for the object, typically 'chat.completion'.

created
integer
required

Unix timestamp when the response was created.

choices
object[]
required

Contains the generated responses, along with meta-information about each.

model
string

Identifier for the model used in generating the response.

usage
object
compliance_violations
enum<string>[]

List of detected content violations when compliance checking is enabled.

Example:
["drug_use"]
I