We use cookies. Cookies and browser storage keep you signed in and remember your preferences. With your permission we also measure how the site is used. You can any time. See our cookie policy.

OpenAI: GPT-4

openai/gpt-4
TextInput: textTools8KAdded May 28, 2023

Try OpenAI: GPT-4 now

Runs on your balance at the prices above. New accounts start with free usage.

One API. Every model.

5 of 5 free messages left today. A free account adds free usage and an API key.Create free accountSign in

Session cost $0.00

OpenAI: GPT-4 at a glance

  • Input price is 6567% higher than the median of 434 Text models.
  • Supports tool (function) calling for agents and integrations.
  • Supports structured JSON output with a schema.
  • A typical request (1,000 input / 500 output tokens) costs about $0.21.

About OpenAI: GPT-4

GPT-4 is a text model from OpenAI, listed on api14 under the model id openai/gpt-4. It sits in the text category and is described by the provider as OpenAI's flagship large-scale language model, built to solve difficult problems with greater accuracy than earlier models through broader general knowledge and advanced reasoning. The provider release date is 2023-05-28, and the model's knowledge cutoff is 2021-09-30.

On api14 the model accepts text input and returns text output. It has a context length of 8191 tokens and a maximum output of 4096 tokens. Supported request parameters include temperature, top_p, frequency_penalty, presence_penalty, stop, seed, logit_bias, logprobs, top_logprobs, max_tokens, max_completion_tokens, response_format, structured_outputs, tools and tool_choice. That combination covers sampling controls, deterministic-ish behaviour via seed, token-level inspection through logprobs, and function calling through the tools parameters.

The practical uses follow from those capabilities. General reasoning and knowledge-heavy question answering fit the model's stated strengths. Longer prompts are workable within the 8191 token context, so document summarisation, multi-paragraph drafting, extraction and rewriting tasks are reasonable, as long as the input plus the requested output stay inside the window. Because tools and tool_choice are supported, the model can be used as the reasoning step in an agent or workflow that calls external functions. Structured outputs and response_format help when you need machine-readable results rather than free prose, and logprobs or top_logprobs are useful when you want to inspect how confident the model was at each token, for example in classification or evaluation pipelines.

Calling it through api14 works the same way as any other OpenAI-compatible endpoint. Send a chat completions request to the gateway with the model field set to openai/gpt-4, and pass your chosen parameters in the request body. Because the API is OpenAI-compatible, existing OpenAI client libraries and code can usually be pointed at api14 by changing the base URL and API key, with no other changes to the request shape. You can set temperature and top_p for sampling, max_tokens or max_completion_tokens to cap the response, stop sequences to end generation early, and seed when you want more repeatable outputs. For tool use, supply tools and optionally tool_choice; for structured results, use response_format or structured_outputs.

A few limits are worth keeping in mind. The context window of 8191 tokens is modest by current standards, so very long documents or long multi-turn conversations may need chunking or trimming. The knowledge cutoff of 2021-09-30 means the model has no awareness of events after that date, so anything time-sensitive should be supplied in the prompt or fetched through tools. Input is text only, so images and audio are out of scope here. If your task depends on a much larger context, more recent knowledge, or non-text input, a different model on api14 is likely a better fit.

How to call the OpenAI: GPT-4 API

  1. Create an API key in your dashboard.
  2. Install the official openai SDK for your language.
  3. Set baseURL to https://api14.com/api/v1 and model to "openai/gpt-4".
import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "https://api14.com/api/v1",
  apiKey: process.env.API14_API_KEY,
});

const result = await client.chat.completions.create({
  "model": "openai/gpt-4",
  "messages": [
    {
      "role": "user",
      "content": "Explain vector databases in two sentences."
    }
  ]
});
console.log(result.choices[0].message.content);

Supported parameters

frequency_penaltylogit_biaslogprobsmax_completion_tokensmax_tokenspresence_penaltyresponse_formatseedstopstructured_outputstemperaturetool_choicetoolstop_logprobstop_p

Specifications

Context length
8,191
Max output
4,096
Input
text
Output
text
Knowledge cutoff
2021-09-30

Requests on api14 · last 7 days

10-1710-1810-1910-2010-2110-2210-23

OpenAI: GPT-4: frequently asked questions

How much does the OpenAI: GPT-4 API cost?
OpenAI: GPT-4 costs Input $105.00 / 1M tokens. It is charged from your USD balance only for successful requests; failed requests are free.
What is the context window of OpenAI: GPT-4?
OpenAI: GPT-4 reads up to 8,191 tokens per request: prompt, history and documents together. It writes up to 4,096 output tokens per response.
What can OpenAI: GPT-4 do?
OpenAI: GPT-4 accepts text and returns text. It supports tool calling, structured JSON output.
How do I call OpenAI: GPT-4 from my code?
Point any OpenAI SDK at https://api14.com/api/v1 and set the model to "openai/gpt-4". No other code changes. Copy a ready example from the code panel on this page.
What are alternatives to OpenAI: GPT-4?
Comparable Text models at a similar price: Anthropic: Claude Opus 4.1, OpenAI: GPT-5.2 Pro (batch), OpenAI: o3 Pro. Each runs through the same API key, so switching is one string.

OpenAI: GPT-4 community

New topic

This community has no topics yet. Open the first one about OpenAI: GPT-4.