openai/types.ts

librechat · packages/api/src/agents/openai/types.ts · typescript · MIT
ai

TypeScript types for OpenAI chat completions.

// Source: https://github.com/danny-avila/librechat | License: MIT | Copyright 2026 LibreChat
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * OpenAI-compatible types for the agent chat completions API.
 * These types follow the OpenAI API spec for /v1/chat/completions.
 *
 * Note: This API uses agent_id as the "model" parameter per OpenAI spec.
 * In the future, this will be extended to support the Responses API.
 */

/**
 * Content part types for OpenAI format
 */
export interface OpenAITextContentPart {
  type: 'text';
  text: string;
}

export interface OpenAIImageContentPart {
  type: 'image_url';
  image_url: {
    url: string;
    detail?: 'auto' | 'low' | 'high';
  };
}

export type OpenAIContentPart = OpenAITextContentPart | OpenAIImageContentPart;

/**
 * T

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key