Skip to main content
POST
/
chat
/
completions
curl --request POST \
  --url https://platform.qubrid.com/v1/chat/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "model": "Hunyuan/Hunyuan-OCR-1B",
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Extract all text from this image and preserve the layout structure."
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/document.png"
          }
        }
      ]
    }
  ],
  "max_tokens": 8192,
  "temperature": 0.1,
  "top_p": 1,
  "stream": false
}
'
{
  "id": "chatcmpl-ocr-123456",
  "object": "chat.completion",
  "created": 1710000000,
  "model": "Hunyuan/Hunyuan-OCR-1B",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "INVOICE #2024-001\nDate: March 30, 2024\n\nBilled To:\nJohn Smith\n123 Main Street\nNew York, NY 10001\n\nItems:\n1. Service A - $100.00\n2. Service B - $250.00\n\nTotal: $350.00"
      },
      "finish_reason": "stop"
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Body

application/json
model
string
required

The OCR-specialized vision model to use for text extraction.

Example:

"Hunyuan/Hunyuan-OCR-1B"

messages
object[]
required

Chat-style input containing text instructions and image content for OCR processing.

max_tokens
integer
default:8192

Maximum number of tokens to generate in the OCR response.

temperature
number
default:0.1

Sampling temperature for text extraction (lower = more deterministic).

top_p
number
default:1

Nucleus sampling parameter for OCR output.

stream
boolean
default:false

Whether to stream OCR output incrementally.

Response

OCR text extraction completed successfully

Standard OpenAI-compatible chat completion response with extracted text.

id
string
Example:

"chatcmpl-ocr-123456"

object
string
Example:

"chat.completion"

created
integer
Example:

1710000000

model
string
Example:

"Hunyuan/Hunyuan-OCR-1B"

choices
object[]