godo.AgentPlatform.GetOpenAIAPIKey()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.AgentPlatform.GetOpenAIAPIKey(ctx context.Context, openaiApiKeyId string) (*godo.OpenAiApiKey, *godo.Response, error)

Description

This method sends a GET request to /v2/gen-ai/openai/keys/{}.

Parameters

openaiApiKeyId string required

Returns

*godo.OpenAiApiKey
*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.OpenAiApiKey

OpenAiApiKey represents the OpenAI API Key information

CreatedAt *godo.Timestamp

Omitted from JSON when empty. JSON key: created_at

CreatedBy string

Omitted from JSON when empty. JSON key: created_by

DeletedAt *godo.Timestamp

Omitted from JSON when empty. JSON key: deleted_at

Models []*godo.Model

Omitted from JSON when empty. JSON key: models

Name string

Omitted from JSON when empty. JSON key: name

UpdatedAt *godo.Timestamp

Omitted from JSON when empty. JSON key: updated_at

Uuid string

Omitted from JSON when empty. JSON key: uuid

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.GetOpenAIAPIKey(ctx, "<your-openai-api-key-id>")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

More Information

See GET /v2/gen-ai/openai/keys/{} 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.