Get API

GET API · Developer integrations

OpenAI-compatible API setup with a working request example

Get API uses https://relay-api.getapi.pro/v1 as the base URL, authenticates with a Bearer API key, and accepts a JSON body containing model and messages at /chat/completions. Compatibility reduces basic migration effort but does not make every provider-specific parameter identical; use the integration guide for complete parameters, streaming behavior, and error handling.

Configure the SDK base URL, not the full endpoint

Use the base URL when constructing the SDK client; it appends the operation path. Supplying the full chat endpoint as the base URL can produce a duplicated path. The example below uses Chat Completions, not Responses or an Anthropic-native request.

  • Base URL: https://relay-api.getapi.pro/v1
  • Authorization: Bearer followed by your Get API key, not an OpenAI-issued key
  • Select model from the current catalog

Compatibility is not feature identity

A shared message shape can remain stable while roles, sampling controls, tools, and media formats vary by model. Validate every non-core feature explicitly instead of relying on silent field handling.

  • Create a test for each optional parameter
  • Retain real error responses
  • Validate downstream response structure

Troubleshoot the first request

For an authentication error, check the key and the service that issued it. For a missing model or route, compare the exact model identifier, account access, and final request path. A timeout or upstream error does not prove your key is invalid; inspect the response before retrying.

  • Do not append the operation path twice
  • Keep keys out of browser code and redact them from diagnostic logs
  • Start with one short, non-streaming request; do not enable automatic retries while diagnosing an uncertain result

Python request example

Install the openai package and run in a local terminal or on your server. Use your own key and an available model; real requests may incur charges. Never embed keys in a web page. The migration example selects the provider through server environment variables, without automatic retries or fallback.

# python -m pip install openai
from getpass import getpass
from openai import OpenAI

model = input("Model identifier from the Get API catalog: ").strip()
with OpenAI(
    base_url="https://relay-api.getapi.pro/v1",
    api_key=getpass("Get API key: "),
    timeout=30.0,
    max_retries=0,
) as client:
    response = client.chat.completions.create(
        model=model,
        messages=[{"role": "user", "content": "Reply with a short greeting."}],
    )
    print(response.choices[0].message.content)

Frequently asked questions

What is the complete chat endpoint?

The complete endpoint is https://relay-api.getapi.pro/v1/chat/completions.

Can a browser call the public base URL directly?

The URL is public, but a production API key should not be exposed in browser code. Use your own secure backend.

Why might an OpenAI parameter not work on another model?

Compatibility covers the common request shape, while model-specific features depend on actual support and documented mapping.

Business inquiries: business@honeykid.cn