llmreference
OpenAI API

Using GPT-4o (05-13) on OpenAI API

Implementation guide · GPT-4o · OpenAI

Serverless

Quick Start

  1. 1
    Create an account at OpenAI API and generate an API key.
  2. 2
    Use the OpenAI API SDK or REST API to call gpt-4o-2024-05-13 — see the documentation for request format.
  3. 3
    You'll be billed $2.50/1M input, $10.00/1M output tokens. See full pricing.

Code Examples

Install
pip install openai
API key
OPENAI_API_KEY
Model ID
gpt-4o-2024-05-13

Use the model slug directly, e.g. "gpt-4o" or "gpt-4.1-mini".

import os
from openai import OpenAI

client = OpenAI()  # reads OPENAI_API_KEY from env
response = client.chat.completions.create(
    model="gpt-4o-2024-05-13",
    messages=[{"role": "user", "content": "Hello"}]
)
print(response.choices[0].message.content)

About OpenAI API

OpenAI's AI platform offers a comprehensive suite of advanced technologies designed to revolutionize various applications across industries. At its core, the platform features powerful natural language processing capabilities for generating human-like text, image generation through models like DALL-E, and automatic speech recognition with Whisper. These functionalities are complemented by robust predictive analytics tools that enable businesses to forecast user behavior and automate customer interactions through sophisticated chatbots. The platform's APIs facilitate seamless integration, allowing users to develop custom solutions that leverage machine learning for analyzing large datasets, automating repetitive tasks, and enhancing decision-making processes. One of the platform's key strengths lies in its flexibility and customization options. Users can fine-tune models to better align with their specific needs, ensuring that AI outputs are tailored to individual organizational requirements. This adaptability, combined with the platform's advanced security features such as data encryption and multi-factor authentication, makes it a powerful tool for businesses looking to innovate rapidly and maintain a competitive edge. By automating knowledge-based tasks and providing personalized recommendations and insights, the platform significantly enhances operational efficiency and customer experience, enabling organizations to scale operations effectively and foster customer loyalty .

OpenAI is a leading AI research and deployment company dedicated to developing safe and beneficial artificial general intelligence (AGI) for humanity. Their AI platform encompasses a range of cutting-edge technologies and models, including: 1. Large language models like GPT (Generative Pre-trained Transformer) series, which power applications such as ChatGPT for natural language processing and generation. 2. DALL-E, an AI system for creating and editing images from text descriptions. 3. Whisper, an automatic speech recognition system capable of transcribing and translating multiple languages. 4. Codex, which translates natural language to code and powers GitHub Copilot. 5. GPT-4, their most advanced language model, capable of understanding and generating human-like text across a wide range of topics and tasks. OpenAI's platform focuses on continual advancement in machine learning, natural language processing, computer vision, and robotics. They prioritize safety and ethics in AI development, aiming to ensure that AGI benefits all of humanity. The company offers APIs and tools for developers to integrate their AI technologies into various applications and services, fostering innovation across industries .

Pricing on OpenAI API

TypePrice (per 1M)
Input tokens$2.50
Output tokens$10.00
Image input$3.83

Capabilities

VisionMultimodalStructured OutputsCode Execution

About GPT-4o (05-13)

GPT-4o, or GPT-4 Omni, is OpenAI's premier multimodal AI model, introduced on May 13, 2024. It is designed to handle and generate content from various input types, including text, audio, and visual data, using a unified model, unlike its predecessors which required separate models for different modalities. This model is notable for its rapid response times averaging 320 milliseconds, which align with human conversational speed, along with being 50% more cost-effective than GPT-4 Turbo. Although it mirrors GPT-4 Turbo in standard benchmark performance, GPT-4o excels in multilingual, audio, and vision tasks. Despite its advancements, it shares the limitation of a knowledge cutoff at October 2023 and is prone to generating incorrect information, like other language models. A more compact and economical version, GPT-4o mini, is also available.

Model Specs

Released2024-05-13
Parameters1.76T (8x222B MoE)*
Context128K
ArchitectureMixture of Experts
Knowledge cutoff2023-10

Provider

OpenAI API
OpenAI API

OpenAI

San Francisco, California, United States