Standard Chat

Basic chat completion endpoint using standard language models on Subnet 1.


POSTv1/1/chat/completions

Generate a response

Generate AI-driven responses using various language models.

Required attributes

  • Name
    model
    Type
    string
    Description

    The model to use for generating responses.

  • Name
    messages
    Type
    array
    Description

    Array of message objects with role (user, assistant, or system) and content.

Optional attributes

  • Name
    temperature
    Type
    number
    Description

    Controls randomness (0-1). Defaults to 0.1.

  • Name
    max_tokens
    Type
    integer
    Description

    Maximum length of generated response. Defaults to 500.

  • Name
    stream
    Type
    boolean
    Description

    Whether to stream responses. Defaults to true.

  • Name
    logprobs
    Type
    boolean
    Description

    Whether to include log probabilities. Defaults to false.

Request

POST
v1/1/chat/completions
curl -X POST "https://api.bitmind.ai/oracle/v1/1/chat/completions" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama-3",
    "messages": [
      {
        "role": "user",
        "content": "Hello, how are you?"
      }
    ],
    "temperature": 0.1,
    "max_tokens": 500,
    "top_p": 1,
    "stream": false,
    "logprobs": false
  }'

Response

{
  "id": "chatcmpl-CgPOAiO6T9KfqiizhxTJpQ",
  "object": "chat.completion",
  "created": 1739377986,
  "model": "llama-3-1-70b",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello! I'm just a language model, so I don't have feelings or emotions like humans do, but I'm functioning properly and ready to help with any questions or tasks you may have. How about you? How's your day going?"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 86,
    "total_tokens": 105
  },
  "system_fingerprint": null
}

The standard chat model

The standard chat model contains the chat completion results.

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the completion.

  • Name
    object
    Type
    string
    Description

    Object type, always "chat.completion".

  • Name
    created
    Type
    integer
    Description

    Unix timestamp of when the completion was created.

  • Name
    model
    Type
    string
    Description

    The model used for completion.

  • Name
    choices
    Type
    array
    Description

    Array containing the completion messages, including:

    • message.role: Role of the message sender
    • message.content: The message content
  • Name
    usage
    Type
    object
    Description

    Token usage statistics for the completion.

  • Name
    system_fingerprint
    Type
    string | null
    Description

    System fingerprint for the completion, if available.