To list all models, send a GET request to /v2/gen-ai/models.
Parameters
Returns
List Available Models
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/-go"
"github.com/stainless-sdks/-go/option"
)
func main() {
client := gradient.NewClient(
option.WithAccessToken("My Access Token"),
)
models, err := client.Models.List(context.TODO(), gradient.ModelListParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", models.Links)
}
{
"links": {
"pages": {
"first": "example string",
"last": "example string",
"next": "example string",
"previous": "example string"
}
},
"meta": {
"page": 123,
"pages": 123,
"total": 123
},
"models": [
{
"id": "llama3.3-70b-instruct",
"agreement": {
"description": "example string",
"name": "example name",
"url": "example string",
"uuid": "123e4567-e89b-12d3-a456-426614174000"
},
"created_at": "2021-01-01T00:00:00Z",
"is_foundational": true,
"kb_default_chunk_size": 123,
"kb_max_chunk_size": 123,
"kb_min_chunk_size": 123,
"name": "Llama 3.3 Instruct (70B)",
"parent_uuid": "\"12345678-1234-1234-1234-123456789012\"",
"updated_at": "2021-01-01T00:00:00Z",
"upload_complete": true,
"url": "https://example.com/model.zip",
"uuid": "\"12345678-1234-1234-1234-123456789012\"",
"version": {
"major": 123,
"minor": 123,
"patch": 123
}
}
]
}Returns Examples
{
"links": {
"pages": {
"first": "example string",
"last": "example string",
"next": "example string",
"previous": "example string"
}
},
"meta": {
"page": 123,
"pages": 123,
"total": 123
},
"models": [
{
"id": "llama3.3-70b-instruct",
"agreement": {
"description": "example string",
"name": "example name",
"url": "example string",
"uuid": "123e4567-e89b-12d3-a456-426614174000"
},
"created_at": "2021-01-01T00:00:00Z",
"is_foundational": true,
"kb_default_chunk_size": 123,
"kb_max_chunk_size": 123,
"kb_min_chunk_size": 123,
"name": "Llama 3.3 Instruct (70B)",
"parent_uuid": "\"12345678-1234-1234-1234-123456789012\"",
"updated_at": "2021-01-01T00:00:00Z",
"upload_complete": true,
"url": "https://example.com/model.zip",
"uuid": "\"12345678-1234-1234-1234-123456789012\"",
"version": {
"major": 123,
"minor": 123,
"patch": 123
}
}
]
}