OpenAI compatibility
You can use the official OpenAI client libraries to call AI Foundry Hub by simply pointing them at our base URL and supplying your API key.
from openai import OpenAI
client = OpenAI( base_url="https://api.aifoundryhub.com/v1", api_key="AI_FOUNDRY_HUB_API_KEY",)package main
import ( "os" openai "github.com/openai/openai-go" "github.com/openai/openai-go/option")
func main() { _ = openai.NewClient( option.WithAPIKey(os.Getenv("AI_FOUNDRY_HUB_API_KEY")), option.WithBaseURL("https://api.aifoundryhub.com/v1"), )}import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.AI_FOUNDRY_HUB_API_KEY, baseURL: "https://api.aifoundryhub.com/v1",});Most generative-model endpoints - chat completions, streaming, images, embeddings, and audio — are supported out of the box by these clients.
You can initialize an OpenAI-compatible client to talk to AI Foundry Hub by pointing its base URL and API key at our service. For full details on each library, see: