Skip to main content
POST
/
images
/
classify
Python SDK
from viscribe import Client

client = Client(api_key="your-api-key-here")

resp = client.classify_image(
    image_url="https://example.com/image.jpg",
    classes=["cat", "dog", "bird"]
)

print(resp.classification)
{
  "request_id": "<string>",
  "credits_used": 123,
  "classification": [
    "<string>"
  ]
}

Authorizations

VISCRIBE-APIKEY
string
header
required

API key authentication. Include your API key in the VISCRIBE-APIKEY header.

Body

application/json
image_url
string

URL of the image to classify. Must be publicly accessible. Either image_url or image_base64 is required.

image_base64
string

Base64 encoded string of the image. Format: data:image/jpeg;base64,... or data:image/png;base64,.... Either image_url or image_base64 is required.

classes
string[]

If provided, classify the image among these specific classes. If not provided, uses general knowledge classification.

class_descriptions
object

Optional descriptions for each class to aid zero-shot classification. Keys must match class names in classes.

instruction
string

Optional instruction to guide classification (e.g., 'Classify the main subject').

multi_label
boolean
default:false

Whether to allow multiple class predictions.

Response

Successful response

request_id
string
required

Unique identifier for this request.

credits_used
integer
required

The number of credits used (always 1 for classify).

classification
string[]
required

List of predicted class names. Contains one item if multi_label is false, multiple items if true.