Skip to content
GetAPI
English
Menu

GetAPI.ONE

Call GetAPI.ONE from Python

Install the official OpenAI Python SDK, point it at the ONE base URL, make a controlled Responses request, and verify the result without putting credentials in source code.

Prepare the project and credential

  • Python 3.10 or newer and a virtual environment.
  • An enabled GetAPI.ONE API key with a deliberate expiry and quota.
  • A model ID copied from the current catalog whose declared endpoint is Responses.
powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade openai

Configure and send the request

  1. Set GETAPI_ONE_API_KEY in the process environment; do not paste the key into the file.
  2. Create the client with https://www.getapi.one/v1 as base_url.
  3. Replace the conspicuous model placeholder with an exact current catalog ID that declares Responses.
  4. Run the script only when you accept that the request may be billed.
  5. The first verification disables SDK retries. Add only bounded, observable retries after deciding which operations are safe to repeat.
python main.py
import os
from openai import OpenAI

api_key = os.environ.get("GETAPI_ONE_API_KEY")
if not api_key:
    raise RuntimeError("Set GETAPI_ONE_API_KEY before running this program")

with OpenAI(
    api_key=api_key,
    base_url="https://www.getapi.one/v1",
    timeout=30.0,
    max_retries=0,
) as client:
    response = client.responses.create(
        model="<MODEL_ID_FROM_CURRENT_CATALOG>",
        input="Reply with one short readiness check.",
    )
    print(response.output_text)

Understand the contract

FieldRequired value
base_urlhttps://www.getapi.one/v1
api_keyGETAPI_ONE_API_KEY from the server environment
modelExact ID from the current catalog
methodclient.responses.create

Verify the expected result

  • The process exits without an authentication or endpoint error.
  • response.output_text contains the requested short answer.
  • The GetAPI.ONE console shows a matching request or usage record for the key.

Fix common errors

SymptomCheck
401 or authentication errorRe-copy the ONE key, confirm it is enabled, and verify the environment variable belongs to this process.
404Keep exactly one /v1 in base_url and use the Responses method only for a model that declares that endpoint.
Model unavailable or incompatibleCopy the exact ID again from the current catalog; do not infer aliases.

Keep the integration safe

  • Run the SDK only in trusted server or local tooling code, never in browser JavaScript.
  • Exclude .env files from version control and rotate a key immediately if it is exposed.
  • Use separate bounded keys for development and production.

Next steps