API Reference

Getting Started With OpenAI SDK

This page will help you get started with List Models.

No need to change your code when switching between models or providers. You can use code samples, like this::

from openai import OpenAI
client = OpenAI(
    base_url="https://unione.ai/openai/v1",
    api_key="your-key",
)

ms = client.models.list()
for m in ms:
    print(m.id, m.owned_by)
package main

import (
    "fmt"

    openai "github.com/sashabaranov/go-openai"
)

const token = "your-key"

func main() {
    conf := openai.DefaultConfig(token)
    conf.BaseURL = "https://unione.ai/openai/v1"
    client := openai.NewClientWithConfig(conf)
    
    // list models
    ms, err := client.ListModels(context.Background())
    if err != nil {
        fmt.Printf("ListModels error: %v\n", err)
        return
    }
    for _, m := range ms.Models {
        fmt.Printf("%s by [%s]\n", m.ID, m.OwnedBy)
    }
}

Try typing / to see how easy it is to add more content!