API Access

Documentation

POST/v1/label

Classify text content based on your custom criteria.

Base URL
https://api.zentropi.ai
Authentication
Authorization: Bearer your_api_key_here
Request Body
Field Type Required Description
content_text string Conditional The text content to be labeled. At least one of content_text or content_image or content_video is required. Text can be provided together with image or video for multimodal labeling.
content_image string Conditional Base64-encoded image data (data URL format). At least one of content_text, content_image, or content_video is required. Both can be provided together. 5MB max size. Subscriber Only
content_video string Conditional Base64-encoded video data (data URL format). At least one of content_text, content_image, or content_video is required. Can be combined with content_text. 25MB max size, 60s max duration. Subscriber Only
criteria_text string Conditional The labeling criteria to use. Exactly one of criteria_text or labeler_id is required.
labeler_id string Conditional The ID of the labeler to use. Exactly one of criteria_text or labeler_id is required.
labeler_version_id string No The ID of which deployed version to use. Only used with labeler_id. Default: "latest"
model string No Model to use for evaluation:
  • cope-latest (default) - currently cope-a-9b for text and cope-b-12b for images
  • cope-a-9b - 1st gen text model
  • cope-b-12b - 1st gen image model (subscriber-only; will deprecate 7/1/2026)
  • cope-b-a4b - 2nd gen text model (public preview)
  • cope-b-a4b-mm - 2nd gen multimodal model (subscriber-only preview)
Important: On 7/1/2026, cope-latest will default to cope-b-a4b for text and cope-b-a4b-mm for multimodal labeling. cope-b-12b will be deprecated at that time.
Response
Field Type Description
label string The classification result ("0" or "1")
confidence float Confidence score for the classification (0.5 to 1.0)
compute_time float Time taken to process the request in seconds
Example Response
{
  "label": "1",
  "confidence": 0.87,
  "compute_time": 0.324
}
Status Codes
  • 200 - Success
  • 401 - Unauthorized (invalid API key)
  • 422 - Validation Error (missing required fields)
  • 500 - Internal Server Error

Code Samples

Python
import requests

ZAPI_KEY = "your_api_key_here"
ZAPI_URL = "https://api.zentropi.ai/v1/label"

content_text = "This is a funny joke"
criteria_text = "Label jokes"

response = requests.post(
    ZAPI_URL,
    headers={"Authorization": f"Bearer {ZAPI_KEY}"},
    json={
        "content_text": content_text,
        "criteria_text": criteria_text,
    }
)

result = response.json()
print(f"Label: {result['label']}")
print(f"Confidence: {result['confidence']}")

# Example output:
# Label: 1
# Confidence: 0.85

# For multimodal examples, see this notebook:
# https://colab.research.google.com/drive/1jfMkpaoX5lAKoGpqVUeyv_4haGn1BUX6
JavaScript
const ZAPI_KEY = "your_api_key_here";
const ZAPI_URL = "https://api.zentropi.ai/v1/label";

// Label content using Z-API
const labelContent = async () => {
  const response = await fetch(ZAPI_URL, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${ZAPI_KEY}`,
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      content_text: "This is a funny joke",
      criteria_text: "Label jokes"
    })
  });

  const result = await response.json();
  console.log(`Label: ${result.label}`);
  console.log(`Confidence: ${result.confidence}`);
};

labelContent();

// Example output:
// Label: 1
// Confidence: 0.85