API¶
API backend configuration for Qwen3-VL text extraction.
Uses litellm for provider-agnostic inference (OpenRouter, Gemini, Azure, etc.).
QwenTextAPIConfig
¶
Bases: BaseModel
API backend configuration for Qwen text extraction.
Uses litellm for provider-agnostic API access. Supports OpenRouter, Gemini, Azure, OpenAI, and any other litellm-compatible provider.
API keys can be passed directly or read from environment variables.
Example
# OpenRouter (reads OPENROUTER_API_KEY from env)
config = QwenTextAPIConfig(
model="openrouter/qwen/qwen3-vl-8b-instruct",
)
# With explicit key
config = QwenTextAPIConfig(
model="openrouter/qwen/qwen3-vl-8b-instruct",
api_key=os.environ["OPENROUTER_API_KEY"],
api_base="https://openrouter.ai/api/v1",
)