Pick the right endpoint family first. Point your OpenAI SDK at https://api.deepinfra.com/v1/openai for chat, embeddings, and image gen. If you need speech recognition, object detection, or other model types with no OpenAI equivalent, use the native POST https://api.deepinfra.com/v1/inference/{model_name} instead. In both cases auth is a Bearer token in the Authorization header, available from the DeepInfra dashboard API keys page.

Context: DeepInfra docs API Reference intro (deepinfra/docs api-reference/introduction.mdx): The DeepInfra API offers two endpoint families. OpenAI-compatible endpoints live at /v1/openai and are a drop-in replacement for OpenAI chat completions, embeddings, and image generation with any OpenAI SDK. DeepInfra native endpoints live at /v1/inference/{model_name} and expose model types the OpenAI schema does not, such as speech recognition, object detection, and image classification. All endpoints need a Bearer token in the Authorization header.