API quickstart

One key.
One request.

MCP for agents ↗︎

Make your first model call in a few minutes. JustAPI accepts the OpenAI request format, so most existing integrations only need a new base URL and API key.

OpenAI compatibleNo SDK lock-inRequest-level costs
01

Create an API key.

Generate a token in the console, then keep it in an environment variable. Never expose a secret key in browser code or commit it to source control.

Create API key ↗︎
Environment variableJUSTAPI_API_KEY=sk-••••••••
02

Choose a chat format.

JustAPI supports three chat formats used by common SDK integrations. A model’s detail panel shows which formats it accepts.

REQUEST FORMAT
OPENAI-COMPATIBLEPOST /chat/completions
Authentication
Authorization: Bearer <KEY>
System instruction
A system item inside messages
Message roles
system, user, assistant, tool
Response text
choices[0].message.content
{
  "model": "gpt-5.4-mini",
  "messages": [
    { "role": "system", "content": "Be concise." },
    { "role": "user", "content": "Hello" }
  ]
}

Chat Completions offers the broadest model compatibility. Check Models for per-model endpoint support.

03

Send your first request.

This example uses OpenAI Chat Completions. Set https://api.justapi.ai/v1 as the base URL and choose a compatible model ID from the live catalogue.

04

Read the response.

The response shape follows the protocol selected above. Every format includes usage information for token accounting.

OPENAI · CHAT COMPLETIONSresponse.choices[0].message.content
05

Choose what to ship.

Compare input and output rates, inspect tiered pricing, or connect an agent to the token-efficient JustAPI remote MCP server.