Models
List models
Section titled “List models”GET https://api.client.com/v1/models
Lists the currently available models, and provides basic information about each one such as the owner and availability.
curl https://api.aifoundryhub.com/v1/models \ -H "Authorization: Bearer $AI_FOUNDRY_HUB_API_KEY"import OpenAI from "openai";
const client = new OpenAI({apiKey: process.env.AI\_FOUNDRY\_HUB\_API\_KEY,baseURL: "[https://api.aifoundryhub.com/v1](https://api.aifoundryhub.com/v1)",});
async function main() {const list = await client.models.list();for await (const model of list) {console.log(model);}}
main();package main
import ( "context" "fmt" "os"
openai "github.com/openai/openai-go" "github.com/openai/openai-go/option")
func main() { client := openai.NewClient( option.WithAPIKey(os.Getenv("AI_FOUNDRY_HUB_API_KEY")), option.WithBaseURL("https://api.aifoundryhub.com/v1"), )
ctx := context.Background() it, err := client.Models.List(ctx) if err != nil { panic(err) } for _, model := range it.Data { fmt.Println(model.ID) }}import osfrom openai import OpenAI
client = OpenAI( api_key=os.getenv("AI_FOUNDRY_HUB_API_KEY"), base_url="https://api.aifoundryhub.com/v1",)
models = client.models.list()for m in models: print(m)Returns
Section titled “Returns”A list of model objects.
Example response
Section titled “Example response”{ "object": "list", "data": [ { "id": "model-id-0", "object": "model", "created": 1686935002, "owned_by": "organization-owner" }, { "id": "model-id-1", "object": "model", "created": 1686935002, "owned_by": "organization-owner" }, { "id": "model-id-2", "object": "model", "created": 1686935002, "owned_by": "openai" } ]}Retrieve model
Section titled “Retrieve model”GET https://api.client.com/v1/models/{model}
Retrieves a model instance, providing basic information about the model such as the owner and permissioning.
Path parameters
Section titled “Path parameters”curl https://api.aifoundryhub.com/v1/models/gpt-5 \ -H "Authorization: Bearer $AI_FOUNDRY_HUB_API_KEY"import OpenAI from "openai";
const client = new OpenAI({ apiKey: process.env.AI\_FOUNDRY\_HUB\_API\_KEY, baseURL: "https://api.aifoundryhub.com/v1",});
async function main() { const model = await client.models.retrieve("gpt-5"); console.log(model);}
main();package main
import ( "context" "fmt" "os"
openai "github.com/openai/openai-go" "github.com/openai/openai-go/option")
func main() { client := openai.NewClient( option.WithAPIKey(os.Getenv("AI_FOUNDRY_HUB_API_KEY")), option.WithBaseURL("https://api.aifoundryhub.com/v1"), )
ctx := context.Background() model, err := client.Models.Get(ctx, "gpt-5") if err != nil { fmt.Println("error:", err) return } fmt.Println(model)}import osfrom openai import OpenAI
client = OpenAI( api_key=os.getenv("AI_FOUNDRY_HUB_API_KEY"), base_url="https://api.aifoundryhub.com/v1",)
model = client.models.retrieve("gpt-5")print(model)Returns
Section titled “Returns”The model object matching the specified ID.
Example response
Section titled “Example response”{ "id": "gpt-5", "object": "model", "created": 1686935002, "owned_by": "openai"}The model object
Section titled “The model object”Describes a model offering that can be used with the API.
Example
Section titled “Example”{ "id": "gpt-5", "object": "model", "created": 1686935002, "owned_by": "openai"}