Get Model

Retrieve information about a specific model using .GetModel().

Basic Usage

var model = await Api.OpenAI
    .GetModel("gpt-4o")
    .ExecuteAsync();

Debug.Log($"Model ID: {model.Id}");
Debug.Log($"Created: {model.Created}");
Debug.Log($"Owner: {model.OwnedBy}");

Model Properties

public class ModelData
{
    public string Id { get; set; }           // Model identifier
    public long Created { get; set; }        // Unix timestamp
    public string OwnedBy { get; set; }      // Organization
    public ModelType Type { get; set; }      // Language, Image, Audio, etc.
}

Unity Integration Examples

Example 1: Model Info Display

Example 2: Model Validator

Example 3: Model Type Checker

Provider Support

OpenAI

Anthropic

Google Gemini

Common Model IDs

OpenAI

  • gpt-4o - Latest GPT-4 Omni

  • gpt-4o-mini - Smaller, faster GPT-4

  • gpt-4-turbo - GPT-4 Turbo

  • gpt-3.5-turbo - GPT-3.5 Turbo

  • dall-e-3 - DALL-E 3

  • whisper-1 - Whisper STT

  • tts-1 - Text-to-Speech

Anthropic

  • claude-3-5-sonnet-20241022 - Claude 3.5 Sonnet

  • claude-3-opus-20240229 - Claude 3 Opus

  • claude-3-haiku-20240307 - Claude 3 Haiku

Google

  • gemini-1.5-pro - Gemini 1.5 Pro

  • gemini-1.5-flash - Gemini 1.5 Flash

  • gemini-1.0-pro - Gemini 1.0 Pro

Best Practices

✅ Good Practices

❌ Bad Practices

Error Handling

Next Steps

Last updated