# OpenAI Model

> OpenAI Model metadata with ID, ownership, and creation timestamp.

- Name: `openai-model`
- Categories: openai
- Detail page: https://open-types.dev/types/openai-model

## Install

```bash
# Types only
npx shadcn add @open-types/openai-model

# Types + Zod v4 validators
npx shadcn add @open-types/openai-model-zod

# Types + real-world examples
npx shadcn add @open-types/openai-model-examples
```

## Types

```typescript
export interface OpenAIModel {
  id: string;
  object: "model";
  created: number;
  owned_by: string;
}

export interface OpenAIModelList {
  object: "list";
  data: OpenAIModel[];
}
```

## Zod validator

```typescript
import * as z from "zod";
import type { OpenAIModel, OpenAIModelList } from "../types/openai-model";

export const openAIModelSchema = z.object({
  id: z.string(),
  object: z.literal("model"),
  created: z.number(),
  owned_by: z.string(),
}) satisfies z.ZodType<OpenAIModel>;

export const openAIModelListSchema = z.object({
  object: z.literal("list"),
  data: z.array(openAIModelSchema),
}) satisfies z.ZodType<OpenAIModelList>;

export type { OpenAIModel, OpenAIModelList } from "../types/openai-model";
```

## Examples

```typescript
// Source: https://platform.openai.com/docs/api-reference/models/object
// Captured: 2026-05
import type { OpenAIModel, OpenAIModelList } from "../types/openai-model";

const gpt4o = {
  id: "gpt-4o",
  object: "model",
  created: 1715367049,
  owned_by: "system",
} as const satisfies OpenAIModel;

const gpt4oMini = {
  id: "gpt-4o-mini",
  object: "model",
  created: 1721172741,
  owned_by: "system",
} as const satisfies OpenAIModel;

const fineTuned = {
  id: "ft:gpt-4o-mini-2024-07-18:my-org::AbCdEfGh",
  object: "model",
  created: 1722400000,
  owned_by: "my-org",
} as const satisfies OpenAIModel;

export const openAIModelExamples = {
  gpt4o,
  gpt4oMini,
  fineTuned,
  embedding: {
    id: "text-embedding-3-small",
    object: "model",
    created: 1705948997,
    owned_by: "system",
  } satisfies OpenAIModel,
} as const;

export const openAIModelListExamples = {
  single: { object: "list", data: [gpt4o] } satisfies OpenAIModelList,
  multiple: {
    object: "list",
    data: [gpt4o, gpt4oMini, fineTuned],
  } satisfies OpenAIModelList,
  empty: { object: "list", data: [] } satisfies OpenAIModelList,
} as const;
```
