Skip to main content

Reuse your client

Pass a custom client when your application already manages provider transport, authentication, retries, or observability outside ViscribeAI. The custom client must expose the OpenAI-compatible Chat Completions shape that ViscribeAI calls internally.
from openai import OpenAI
from viscribe import ViscribeAI

openai_client = OpenAI(api_key="sk-your-provider-key")

client = ViscribeAI(
    model_config={"model": "gpt-5-mini"},
    client=openai_client,
)

result = client.images.describe(image_path="examples/venice.png")

Expected shape

ViscribeAI calls chat.completions.create on the client. The response should match the OpenAI Chat Completions response shape closely enough for ViscribeAI to read choices, message content or parsed output, refusal data, finish reasons, and usage metadata.
Use model_config or modelConfig for model request options even when passing a custom client.