Skip to main content

Account & keys

Credits, activity, and API key management.

// Credits remaining
credits, _ := client.GetCredits(ctx)

// Usage analytics
activity, _ := client.GetActivity(ctx)

// Current key metadata
key, _ := client.GetKey(ctx)

// List / create / update / delete keys (requires a provisioning key)
keys, _ := client.ListKeys(ctx)
newKey, _ := client.CreateKey(ctx, openrouter.CreateKeyRequest{Name: "staging"})

Examples:

See account_models.go and keys_endpoint.go for full field definitions.