llmboxDocumentationSign in
Integrations · OpenAI and ElevenLabs SDKs

OpenAI and ElevenLabs SDKs

Connecting the official OpenAI and ElevenLabs SDKs for Python and Node.

The official SDKs work with the gateway without code changes — set the base URL and the key.

OpenAI SDK

from openai import OpenAI

client = OpenAI(base_url="https://llmbox.cc/v1", api_key="$LLMBOX_API_KEY")
resp = client.chat.completions.create(
    model="openai/gpt-5.6-sol",
    messages=[{"role": "user", "content": "Hello!"}],
)
print(resp.choices[0].message.content)

Without parameters the client reads the OPENAI_BASE_URL and OPENAI_API_KEY variables:

bash
export OPENAI_BASE_URL=https://llmbox.cc/v1
export OPENAI_API_KEY=$LLMBOX_API_KEY

The same client works with Responses (client.responses.create) and images (client.images.generate).

ElevenLabs SDK

The official ElevenLabs SDK works with the audio endpoints. base_url is the gateway address without /v1; the SDK sends the key in xi-api-key.

from elevenlabs.client import ElevenLabs

client = ElevenLabs(base_url="https://llmbox.cc", api_key="$LLMBOX_API_KEY")
voices = client.voices.search(page_size=5)
print([v.name for v in voices.voices])

Retries and timeouts

  • The OpenAI SDK retries 429 and 5xx itself, honoring the Retry-After header — no extra retry code needed. The ElevenLabs Node SDK retries too (the maxRetries option, 2 by default).
  • What is left of the requests-per-minute limit is in the response headers x-ratelimit-limit-requests, x-ratelimit-remaining-requests and x-ratelimit-reset-requests (see Limits).
  • For images, video and reasoning models increase the client timeout: generation may take minutes.