APIMart
Back to all models

GPT-4o API

OpenAIModel ID gpt-4oText modelReleased May 13, 2024

Use GPT-4o to pull fields from an invoice screenshot and check the total, answer a complaint in the customer’s own language, or turn a spoken-style request into the parameters a booking tool needs.

Max input
128,000 tokens
Max output
16,384 tokens
Input → output
Text, Image → Text
Knowledge cutoff
October 1, 2023
  • Image input
  • Streaming
  • Cached input pricing
  • OpenAI SDK compatible

GPT-4o API use cases

Each use case comes with an illustrative example: source material, a prompt and a hand-written sample answer, not actual model output. Copy the prompt, swap in your own material and try it on GPT-4o.

Try GPT-4o with your own material

Pull data from screenshots and documents

Give GPT-4o an invoice, table or page screenshot, have it return the fields you specify as JSON and check the totals along the way. Spot-check a few originals before loading the data.

Example: Is this invoice total right?

Material

Invoice screenshot
Invoice no. INV-2381 · Date 2026-10-08 · Subtotal 1,200.00 · Tax (6%) 72.00 · Total 1,272.00

PromptExtract invoice_no, date, subtotal, tax and total from the invoice screenshot as JSON, and check that the total equals subtotal plus tax.

Sample answer · written by hand to show the reasoning

{"invoice_no": "INV-2381", "date": "2026-10-08", "subtotal": 1200.00, "tax": 72.00, "total": 1272.00}. Check: 1,200.00 + 72.00 = 1,272.00, which matches the total; the tax of 72.00 is also exactly 6% of 1,200.00.

About the GPT-4o API

  • GPT-4 Turbo level, twice as fast

    OpenAI says GPT-4o matches GPT-4 Turbo on text, reasoning and coding; in the API it is 2x faster than GPT-4 Turbo, half the price, with 5x higher rate limits.

  • Vision, function calling, structured outputs

    It takes text and image input and returns text, connects to tools through function calling, returns fields that follow a JSON Schema with structured outputs, and supports streaming.

  • Two snapshots on APIMart

    Per OpenAI’s model page, gpt-4o points to the default snapshot gpt-4o-2024-08-06; APIMart also offers gpt-4o-2024-11-20 as its own model ID.

  • GPT-4o API key and access

    You don’t need a separate GPT-4o API key: one APIMart key works for every model. Check the GPT-4o pricing table on this page for current GPT-4o API pricing, then call an OpenAI Chat Completions-compatible endpoint with the model ID gpt-4o.

How to call the GPT-4o API

To call GPT-4o, you only need an APIMart API key and your existing OpenAI SDK, or send plain HTTP requests.

POST /v1/chat/completions
curl https://api.apimart.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIMART_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "gpt-4o",
  "messages": [
    {
      "role": "user",
      "content": "Describe how to design a clear API in three sentences."
    }
  ],
  "stream": false
}'

GPT-4o access details

Model IDgpt-4o
Base URLhttps://api.apimart.ai/v1
Endpoint/chat/completions

Common parameters

model
Required
messages
Required
stream
Optional
max_tokens
Optional
temperature
Optional
All request parameters, response fields and error codes

GPT-4o API request parameters

GPT-4o uses the general chat endpoint, POST /v1/chat/completions, with a JSON body. model and messages are required; every other parameter is optional.

ParameterTypeRequiredDescription
modelstringYesModel ID. Use gpt-4o for this model.
messagesarrayYesConversation messages. Each message has a role (system, user, or assistant) and content. Include earlier messages for multi-turn conversations.
streambooleanNoWhether to stream the output. true returns chunks over SSE, false returns the full response at once. Default: true.
temperaturenumberNoOutput randomness, 0–2. Default: 1.0. Lower values give more deterministic output.
top_pnumberNoNucleus sampling, 0–1. Default: 1.0. Adjust this or temperature, not both.
max_tokensintegerNoMaximum number of tokens to generate for the reply.
frequency_penaltynumberNoFrequency penalty, -2.0 to 2.0. Default: 0. Positive values reduce repeated wording.
presence_penaltynumberNoPresence penalty, -2.0 to 2.0. Default: 0. Positive values encourage new topics.
stopstring | arrayNoUp to 4 stop sequences. Generation stops when any of them appears.
nintegerNoNumber of replies to generate. Default: 1.

Response fields

The response contains the fields below. Token usage is returned in usage, which you can use to check costs.

FieldTypeDescription
idstringUnique identifier for the request.
modelstringThe model that handled the request.
choicesarrayList of replies. Each item contains message (role and content) and finish_reason.
usageobjectToken usage: prompt_tokens, completion_tokens, and total_tokens.

Error codes

Failed requests return an error object with code, message, and type.

StatusTypeMeaning
400invalid_request_errorInvalid request parameters.
401authentication_errorThe API key is invalid or missing.
402payment_requiredInsufficient account balance.
403permission_errorNo permission to access this resource.
429rate_limit_errorToo many requests. Retry later.
500server_errorInternal server error.
502bad_gatewayGateway error. The service is temporarily unavailable.

GPT-4o API pricing

The GPT-4o API is billed by token usage, and prices depend on your membership tier. Prices below are per million tokens; 1 US dollar = 10 credits.

ItemGoldCurrent pricePlatinumDiamondOfficial priceYou save
Input20Credits~$219Credits~$1.918Credits~$1.825Credits~$2.520%
Cached input10Credits~$19.5Credits~$0.959Credits~$0.912.5Credits~$1.2520%
Output80Credits~$876Credits~$7.672Credits~$7.2100Credits~$1020%

Prices are for reference only. View full pricing

Why call GPT-4o API through APIMart

  • 20% below official pricing

    GPT-4o API pricing is billed by token usage. Gold to Diamond member prices are 20%–28% below OpenAI's official prices, and cached input costs just $1 per 1M tokens.

    See membership prices
  • One API key for 500+ models

    GPT-4o, the rest of its family and 500+ models from GPT, Claude, Gemini and more share one API key and one account balance. Switching models is just a change to the model parameter.

  • Change two lines of existing code

    If you already use the OpenAI SDK, point base_url at https://api.apimart.ai/v1 and swap in your APIMart API key. Requests and responses keep the same format.

  • Try it online before you code

    Try GPT-4o with your own material in the Playground, no code or setup needed, and integrate once you like the results.

    Open Playground

Which OpenAI model should you choose?

Base prices per 1M tokens (USD). Your GPT-4o API key works for every model in the table; just change the model parameter.

Differences between OpenAI models
ComparisonGPT-4o CurrentGPT-4o miniGPT-4o-2024-11-20GPT-4.1GPT-4.1 minio3GPT-5GPT-5 miniGPT-5 nanoGPT-5 ProGPT-5 SearchGPT-5.1GPT-5.2GPT-5.2 ProGPT-5.3-CodexGPT-5.4GPT-5.4 miniGPT-5.4 nanoGPT-5.4 ProGPT-5.5GPT-5.6 LunaGPT-5.6 SolGPT-5.6 TerraGPT-6 AstraGPT-6 LunaGPT-6 SolGPT-6.1 SolGPT-6.1 TerraGPT-6.2 AstraGPT-6.2 Sol
Best forText and image input, Function calling and structured outputs, No reasoning step, fast repliesHigh-volume classification and extraction, Text and image input, Low-cost small modelNewest GPT-4o snapshot, Text and image input, No reasoning step, fast repliesInstruction following, Deprecated, 1M-token contextFast and low-cost, Deprecated, 1M-token contextDeep reasoning, Visual reasoning, Coding and technical writingCoding and agents, Deprecated, Reasoning effort minimal to highCost-efficient reasoning, Deprecated, 400K contextFastest and cheapest, Deprecated, ClassificationHard reasoning, Deprecated, Responses APIWeb search in Chat Completions, Searches before every answer, Text in, text outCoding and agents, Deprecated, Text and image inputProfessional work, Reasoning up to xhigh, Text and image inputHard reasoning, More compute per request, Responses APIAgentic coding, 400K context, Responses APICoding and professional work, 1.05M context, Text and image inputCoding and subagents, 400K context, Text and image inputClassification and extraction, Cheapest GPT-5.4 model, Text and image inputHard reasoning, More compute per request, Text and image inputCoding and professional work, 1.05M context, Reasoning from none to xhighHigh-volume tasks, Classification, Data extractionComplex professional work, Coding and debugging, Text and image inputBalanced cost, Support and review, Text and image inputComplex coding, Professional work, ResearchStructured summaries, Classification, Data extractionComplex coding, Agentic workflows, Testing and debuggingComplex coding, Professional documents, Business workflowsVisual reasoning, Drawings and screenshots, WritingComplex coding, Long-document analysis, Professional researchEveryday coding, Agentic tasks, Writing
Input typesText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageTextText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, ImageText, Image
Max input128,000 tokens128,000 tokens128,000 tokens1,047,576 tokens1,047,576 tokens200,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens272,000 tokens922,000 tokens272,000 tokens272,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens922,000 tokens
Max output16,384 tokens16,384 tokens16,384 tokens32,768 tokens32,768 tokens100,000 tokens128,000 tokens128,000 tokens128,000 tokens272,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens128,000 tokens
Knowledge cutoffOctober 1, 2023October 1, 2023October 1, 2023June 1, 2024June 1, 2024June 1, 2024September 30, 2024May 31, 2024May 31, 2024September 30, 2024—September 30, 2024August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025August 31, 2025December 1, 2025February 16, 2026February 16, 2026February 16, 2026April 30, 2026May 18, 2026April 20, 2026April 30, 2026June 1, 2026May 18, 2026June 1, 2026
Input price$2$0.12$2$1.6$0.32$1.6$1$0.2$0.04$12$1$1$1.4$16.8$1.4$2$0.6$0.16$24$4$0.16$3.2$1.6$8$0.08$1.6$1.6$0.8$6.4$1.6
Output price$8$0.48$8$6.4$1.28$6.4$8$1.6$0.32$96$8$8$11.2$134.4$11.2$12$3.6$1$144$24$0.96$16$9.6$40$0.4$8$8$4$32$8

GPT-4o FAQ

What is GPT-4o’s knowledge cutoff?

OpenAI’s model page lists a knowledge cutoff of October 2023 for GPT-4o. For anything newer, put the relevant information in the prompt.

What changes when I move from GPT-4o to GPT-6 Luna?

Change the model parameter from gpt-4o to gpt-6-luna; the endpoint and API key stay the same. Before switching, re-test your prompts, image inputs and tool definitions, check that the parameters you use are supported by both, and compare the two models’ rates in the pricing tables on this site.

GPT-4o is gone from ChatGPT. Does the API still work?

Yes. OpenAI removed GPT-4o from ChatGPT on February 13, 2026 and said the API was not affected. On APIMart, gpt-4o can be called as usual.

Which version does gpt-4o point to?

According to OpenAI’s model page, the default snapshot of gpt-4o is gpt-4o-2024-08-06. OpenAI later released gpt-4o-2024-11-20, which APIMart also offers as a model ID.

Should I choose GPT-4o or GPT-4o mini?

Both have the same context window, maximum output and input types, and both support image input and structured outputs. GPT-4o is more capable and suits harder image reading, extraction and multi-step tool calls; GPT-4o mini is faster and cheaper, suited to focused high-volume tasks such as classification and extraction.

Is GPT-4o a reasoning model?

No. GPT-4o doesn’t generate reasoning tokens before answering; its output tokens are the visible answer, so latency and cost are easier to predict. For hard multi-step math or coding problems you can switch to a reasoning model, which reasons first and then answers, at the cost of more time and more output tokens.

How can I try this model online?

Click Start chatting or Open Playground to visit the existing APIMart Playground. Select GPT-4o in the text category to start exploring.

Which model ID does the GPT-4o API use?

Set model to gpt-4o. Copy the exact ID from the page heading or the integration details panel.

Is it compatible with the OpenAI SDK?

You can keep the OpenAI SDK. Set base_url to https://api.apimart.ai/v1, provide your APIMart API key, and use the model ID on this page.

What is the context window of GPT-4o?

On APIMart, GPT-4o accepts up to 128,000 input tokens per request. Your prompt, earlier messages, and file content all count toward it.

How many tokens can it output at once?

GPT-4o can output up to 16,384 tokens in a single reply. Use the max_tokens parameter to set a lower limit.

How much does the GPT-4o API cost?

The GPT-4o API on APIMart is billed by token, and prices depend on your membership tier. Gold: $2 per million input tokens and $8 per million output tokens. Diamond: $1.8 per million input tokens and $7.2 per million output tokens. Prices may change; the pricing page has the current rates.

Does it support streaming?

Yes. The general chat endpoint streams over SSE by default. Set stream to false to receive the complete response at once.

How do I get an API key?

Sign in to APIMart and create a key on the API Keys page, then send it in the Authorization: Bearer header. The same key also works for other models on the platform.