godo.AgentPlatform.CreateInferenceRouter()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.AgentPlatform.CreateInferenceRouter(ctx context.Context, create *godo.InferenceRouterCreateRequest) (*godo.InferenceRouter, *godo.Response, error)

Description

CreateInferenceRouter creates a new inference router.

This method sends a POST request to /v2/gen-ai/models/routers.

Parameters

create *godo.InferenceRouterCreateRequest required

Fields of godo.InferenceRouterCreateRequest

InferenceRouterCreateRequest defines the body for creating an inference router. Field names match POST /v2/gen-ai/models/routers (see DigitalOcean API / pydo.genai.create_model_router). FallbackModels must contain at least one non-empty model name (enforced by CreateInferenceRouter).

Name string

JSON key: name

Description string

Omitted from JSON when empty. JSON key: description

Policies json.RawMessage

Omitted from JSON when empty. JSON key: policies

FallbackModels []string

JSON key: fallback_models

Returns

*godo.InferenceRouter
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.InferenceRouter

InferenceRouter represents a GenAI inference router resource.

UUID string

Omitted from JSON when empty. JSON key: uuid

Name string

Omitted from JSON when empty. JSON key: name

Description string

Omitted from JSON when empty. JSON key: description

CreatedAt *godo.Timestamp

Omitted from JSON when empty. JSON key: created_at

UpdatedAt *godo.Timestamp

Omitted from JSON when empty. JSON key: updated_at

Config *godo.InferenceRouterConfig

Omitted from JSON when empty. JSON key: config

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.AgentPlatform.CreateInferenceRouter(ctx, &godo.InferenceRouterCreateRequest{
		Name: "<your-name>",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

More Information

See POST /v2/gen-ai/models/routers in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.