Multimodal Chat

Chat completion and image generation capabilities, including vision-enhanced chat and text-to-image generation on Subnet 19.


POSTv1/19/cortext/chat

Cortext Chat

Generate specialized responses using Cortext-based chat completion.

Required attributes

  • Name
    model
    Type
    string
    Description

    The Cortext model to use (defaults to "cortext-ultra").

  • Name
    messages
    Type
    array
    Description

    Array of message objects with role and content. Each message must include role (enum: "user", "assistant", "system") and content (string).

Optional attributes

  • Name
    temperature
    Type
    number
    Description

    Controls randomness in the response (defaults to 0.0001).

  • Name
    max_tokens
    Type
    integer
    Description

    Maximum number of tokens to generate (defaults to 4000).

  • Name
    top_p
    Type
    number
    Description

    Controls diversity via nucleus sampling (defaults to 1).

  • Name
    stream
    Type
    boolean
    Description

    Whether to stream the response (defaults to true).

  • Name
    seed
    Type
    integer
    Description

    Random seed for reproducibility (defaults to 0).

Request

POST
v1/19/cortext/chat
curl -X POST "https://api.bitmind.ai/oracle/v1/19/text/cortext/chat" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "cortext-ultra",
    "messages": [
      {
        "role": "user",
        "content": "What is machine learning?"
      }
    ],
    "temperature": 0.0001,
    "max_tokens": 100,
    "top_p": 1,
    "stream": false,
    "seed": 1
  }'

Response

[
  {
    "choices": [
      {
        "message": {
          "role": "user",
          "content": "Machine learning is a subset of artificial intelligence (AI) that involves the development of algorithms and statistical models that enable computers to perform tasks without explicit instructions. Instead of being programmed with specific rules, machine learning systems learn from data to identify patterns, make decisions, and improve their performance over time.\n\nKey aspects of machine learning include:\n\n1. **Data Input**: Machine learning models require large amounts of data to learn from. This data can be structured (like databases) or unstructured (like text and"
        },
        "finish_reason": "stop"
      }
    ],
    "system_fingerprint": null,
    "id": "chatcmpl-tEGXiayjTs_QuCyYdRhYyA",
    "created": 1739374983,
    "usage": {
      "prompt_tokens": 25,
      "completion_tokens": 101,
      "total_tokens": 126
    },
    "object": "chat.completion",
    "model": "gpt-4o"
  }
]

POSTv1/19/cortext/text-to-image

Cortext Text to Image

Generate images from text descriptions using Cortext models.

Required attributes

  • Name
    prompt
    Type
    string
    Description

    The prompt used to create the image.

  • Name
    model
    Type
    string
    Description

    The model used to generate the image (defaults to "cortext-image").

  • Name
    style
    Type
    string
    Description

    Optional style parameter.

  • Name
    size
    Type
    string
    Description

    The dimensions of the created image (enum: "256x256", "512x512", "1024x1024", defaults to "1024x1024").

  • Name
    quality
    Type
    string
    Description

    The quality/resolution of the generated images (enum: "hd", "standard", defaults to "standard").

Optional attributes

  • Name
    steps
    Type
    integer
    Description

    Number of steps in the image generation process (allowed values: 5-10, defaults to 5).

  • Name
    cfg_scale
    Type
    integer
    Description

    Classifier-Free Guidance Scale (defaults to 8).

  • Name
    seed
    Type
    integer
    Description

    Random seed for reproducibility (defaults to 0).

Request

POST
v1/19/cortext/text-to-image
curl -X POST "https://api.bitmind.ai/oracle/v1/19/text/cortext/text-to-image" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A beautiful sunset over mountains",
    "model": "cortext-image",
    "style": "vivid",
    "size": "1024x1024",
    "quality": "hd",
    "steps": 30,
    "cfg_scale": 8,
    "seed": 0
  }'

Response

[
  {
    "messages": "Give me an image of a cute, phantom, cockapoo. Very cute, not too fluffy",
    "model": "cortext-image",
    "style": "vivid",
    "size": "1024x1024",
    "quality": "hd",
    "completion": null,
    "steps": 30,
    "sampler": "",
    "cfg_scale": 8,
    "seed": 0,
    "provider": "OpenAI",
    "prompt": "A beautiful sunset over mountains",
    "image_url": "https://corcel.b-cdn.net/3294af65-bb87-4be3-9c46-5f50b39213ab.webp"
  }
]

POSTv1/19/vision/chat

Vision Chat

Generate responses with vision-enhanced capabilities for image-related discussions.

Required attributes

  • Name
    messages
    Type
    array
    Description

    Array of message objects with role and content. Each message must include role (enum: "user", "assistant", "system") and content (string).

Optional attributes

  • Name
    model
    Type
    string
    Description

    The vision model to use (defaults to "llama-3").

  • Name
    temperature
    Type
    number
    Description

    Controls randomness in the response (defaults to 0.1).

  • Name
    max_tokens
    Type
    integer
    Description

    Maximum number of tokens to generate (defaults to 100).

  • Name
    top_p
    Type
    number
    Description

    Controls diversity via nucleus sampling (defaults to 1).

  • Name
    stream
    Type
    boolean
    Description

    Whether to stream the response (defaults to false).

  • Name
    logprobs
    Type
    boolean
    Description

    Whether to include log probabilities (defaults to false).

Request

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

Response

{
  "id": "chatcmpl-Q3g9MriBTyCAh9KrbFVN9g",
  "object": "chat.completion",
  "created": 1739377516,
  "model": "llama-3-1-70b",
  "choices": [
    {
      "message": {
        "role": "assistant",
        "content": "Hello! I'm just a computer program, so I don't have feelings, but thank you for asking! How can I assist you today?"
      }
    }
  ],
  "usage": {
    "prompt_tokens": 19,
    "completion_tokens": 64,
    "total_tokens": 83
  },
  "system_fingerprint": null
}

POSTv1/19/vision/text-to-image

Vision Text to Image

Generate images using the vision model's text-to-image capabilities.

Required attributes

  • Name
    text_prompts
    Type
    array
    Description

    Array of prompt objects, each containing text (string) and optional weight (number).

Optional attributes

  • Name
    cfg_scale
    Type
    integer
    Description

    Classifier free guidance scale (defaults to 2).

  • Name
    steps
    Type
    integer
    Description

    Number of diffusion steps (defaults to 8).

  • Name
    engine
    Type
    string
    Description

    The engine to use (defaults to "proteus").

  • Name
    height
    Type
    integer
    Description

    Output image height in pixels (defaults to 1024).

  • Name
    width
    Type
    integer
    Description

    Output image width in pixels (defaults to 1024).

Request

POST
v1/19/vision/text-to-image
curl -X POST "https://api.bitmind.ai/oracle/v1/19/vision/text-to-image" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "text_prompts": [
      {
        "text": "4 hedgehogs, wearing tuxedos, riding on the back of a crocodile."
      }
    ],
    "cfg_scale": 2,
    "steps": 8,
    "engine": "proteus",
    "height": 1024,
    "width": 1024
  }'

Response

{
  "signed_urls": [
    "https://corcel.b-cdn.net/df42dc09-6de4-4c38-b716-5a0f064304c0.webp"
  ]
}

The multimodal chat model

The multimodal chat model contains the chat completion results.

Properties

  • Name
    choices
    Type
    array
    Description

    Array containing the completion messages, including:

    • message.role: Role of the message sender
    • message.content: The message content
    • finish_reason: Reason why the completion finished
  • Name
    system_fingerprint
    Type
    string | null
    Description

    System fingerprint for the completion, if available.

  • Name
    id
    Type
    string
    Description

    Unique identifier for the completion.

  • Name
    created
    Type
    integer
    Description

    Unix timestamp of when the completion was created.

  • Name
    usage
    Type
    object
    Description

    Token usage statistics for the completion, including prompt:

    • prompt_tokens: Number of tokens in the prompt
    • completion_tokens: Number of tokens in the completion
    • total_tokens: Total number of tokens in the completion
  • Name
    object
    Type
    string
    Description

    Object type, always "chat.completion".

  • Name
    model
    Type
    string
    Description

    The model used for completion.