Inference Cheap

Inference Cheap API

Connect with the OpenAI SDKs and your Inference Cheap key.

For agents — copy the integration prompt.

Connect

ClientBase URL
OpenAI SDKshttps://openai.inference.cheap/v1
Codex CLI / apphttps://codex.inference.cheapsetup

Get an API key from the Inference Cheap team. Pass it as Authorization: Bearer YOUR_API_KEY or the SDK's api_key option. Keep keys server-side.

export INFERENCE_CHEAP_API_KEY="YOUR_API_KEY"
curl --fail-with-body https://openai.inference.cheap/v1/models \
  -H "Authorization: Bearer $INFERENCE_CHEAP_API_KEY"

First request

Install the openai package. Use a model returned by /v1/models.

Python

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["INFERENCE_CHEAP_API_KEY"],
    base_url="https://openai.inference.cheap/v1",
)
response = client.responses.create(model="gpt-5.6-sol", input="Say hello.")
print(response.output_text)

JavaScript

import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.INFERENCE_CHEAP_API_KEY,
  baseURL: "https://openai.inference.cheap/v1",
});
const response = await client.responses.create({
  model: "gpt-5.6-sol",
  input: "Say hello.",
});
console.log(response.output_text);

API endpoints

Paths are relative to https://openai.inference.cheap. All require an API key.

OperationEndpoint
Responses / Chat CompletionsPOST /v1/responses, POST /v1/chat/completions
List / retrieve modelsGET /v1/models, GET /v1/models/{id}
Retrieve / delete a stored responseGET /v1/responses/{id}, DELETE /v1/responses/{id}
Response inputs / background cancellationGET /v1/responses/{id}/input_items, POST /v1/responses/{id}/cancel
Compact input / count tokensPOST /v1/responses/compact, POST /v1/responses/input_tokens
Conversations / files/v1/conversations, /v1/files
Generate / edit imagesImages API
Billing scope and multipliersGET /v1/sub2api/billing

Request options

  • Models: /v1/models lists models available to your key, not prices. Model, tool, and reasoning support depend on your access.
  • Reasoning: omit for defaults. Responses uses reasoning: { effort: "high" }; Chat Completions uses reasoning_effort: "high".
  • Streaming: set stream: true. Read response.output_text.delta events; handle response.failed and response.incomplete. HTTP 200 alone is not success.
  • History: set store: true for later retrieval. Use previous_response_id or a conversation ID, not both; resend instructions for each response.
  • Pricing: ask the team for rates and usage. /v1/sub2api/billing returns scope and multipliers, not per-model prices.

Errors

StatusAction
400 / 404Check the error, request fields, endpoint, model, and resource IDs.
401 / 403Check your key and access.
413Reduce the payload.
429Reduce concurrency; respect Retry-After.
5xxRetry with bounded backoff.

After a timeout, inspect a stored response before repeating the request.

For agents

Copy this Markdown prompt to your agent.

Integrate the API
# Integrate Inference Cheap

- Use the OpenAI SDK with base URL https://openai.inference.cheap/v1.
- Read INFERENCE_CHEAP_API_KEY from the project's secret store; never expose it
  in browser code or logs. Ask the Inference Cheap team if a key is missing.
- Call GET /v1/models before choosing a model; keep the user's choice if available.
- Start with Responses and default options. Preserve existing client settings.
- For streaming, check the final outcome; HTTP 200 is not proof of success.
- When testing is requested, make one small request and report its final result.
- Codex setup: https://docs.inference.cheap/codex
- Image generation: https://docs.inference.cheap/images

On this page