PRIVATE PREVIEW / Public checkout is not open.

A FAMILIAR STARTING POINT

Build with API Relay.

Select models from multiple providers through an OpenAI-compatible API. Keep control of the model, understand the bill, and know where your requests go.

This is a private preview. A catalog listing is not an active service entitlement. Public checkout is not open, and indicative pricing does not constitute an accepted order. An operator must activate your account and confirm the commercial terms.

01 / Overview

The base URL is https://bupt.ai/v1. The initial interface supports non-streaming text chat completions. It does not implement the complete OpenAI API or every provider feature.

EndpointPurposeAuthentication
GET /api/catalogPublic model descriptions, indicative prices and route availability.None
GET /v1/modelsModels currently enabled for your account.Customer key
POST /v1/chat/completionsA text completion from the exact selected model.Customer key
GET /v1/usageAvailable balance, reserved funds, settled spend and recent requests.Customer key

Provider names identify independent third-party services; they do not imply a partnership or endorsement. Gemini is a planned integration with commercial authorization pending. The catalog reports the actual activation state of each route.

02 / Authentication

Use a BUPT.AI customer key issued for your account. Provider credentials stay on the relay server and are never issued to customers. Send your customer key in the Authorization header:

Authorization: Bearer YOUR_BUPT_API_KEY

Keep the key in your server’s secret storage or an environment variable. Do not put it in a public repository, browser bundle, mobile application or shared example. The API is intended for server-to-server use; browser requests from other origins are rejected.

Every completion request must also include X-Bupt-Data-Policy: global. Account activation requires acceptance of the global processing policy. The header does not create an EU-only route.

The usage checker sends your key only to this site’s usage endpoint. The key is held in page memory, is not written to browser storage, and is cleared from the form when the request finishes.

03 / Choose your model

Fetch the models available to your account before making a request. Use the returned id exactly, including the provider prefix:

curl https://bupt.ai/v1/models \
  -H "Authorization: Bearer $BUPT_API_KEY"

The public catalog may list a model while its route is pending activation. GET /v1/models reflects your account’s provider permissions and the routes that are actually enabled.

Model selection is explicit. If a provider fails or your selected model is unavailable, the relay returns an error instead of silently substituting a different model or provider. Native providers can still update their model aliases; an ID is not a guarantee of immutable model weights.

The contextWindow and maxOutputTokens values shown in this catalog are the relay’s configured limits, not claims about a model’s full native capacity. Keep individual requests within those limits. A workload estimate may aggregate tokens across many requests.

04 / Make your first request

Set BUPT_API_KEY in your environment and replace YOUR_MODEL_ID with an ID from your account’s model list. Install the official Python client with pip install openai.

import os
from openai import OpenAI

client = OpenAI(
    base_url="https://bupt.ai/v1",
    api_key=os.environ["BUPT_API_KEY"],
    max_retries=0,
)

response = client.chat.completions.create(
    model="YOUR_MODEL_ID",
    messages=[{
        "role": "user",
        "content": "Explain the difference between latency and throughput."
    }],
    max_tokens=1024,
    stream=False,
    extra_headers={"X-Bupt-Data-Policy": "global"},
)

print(response.choices[0].message.content)

Automatic client retries are disabled in this example because an interrupted response may still represent a completed upstream request. Check usage and the billing status before sending another completion. cURL and server-side JavaScript examples are also available.

The response uses the familiar choices[0].message.content shape. Verified provider token usage is returned when available. Inspect the X-Bupt-Request-Id and X-Bupt-Billing-Status response headers when reconciling a request.

05 / Supported request parameters

ParameterAccepted value
modelExact enabled model ID returned by /v1/models.
messages1–128 messages. Each has only role and string content. Roles: system, user, assistant. Include at least one user message.
streamfalse, or omit. Streaming is not supported in this preview.
max_tokensPositive integer up to the selected route’s output limit. Defaults to 1,024, or the route limit if lower.
temperatureOptional number in [0, 2], subject to the selected provider’s narrower restrictions.
top_pOptional number in [0, 1], subject to the selected provider’s narrower restrictions.
stopOptional string or 1–4 strings, each at most 256 UTF-8 bytes, subject to provider support.

Omit sampling parameters unless you have checked the selected provider’s current requirements. Some Kimi thinking modes require fixed values. A parameter passing the relay’s format check does not guarantee that the provider accepts it.

Requests must be JSON and no larger than 64 KiB. Images, audio, video, tools, function calls, embeddings, files, structured output parameters and streaming are outside this initial API scope. Unsupported parameters are rejected rather than silently ignored.

06 / Billing and account usage

Prices are in USD per 1 million input or output tokens. The public rates are indicative preview service rates, excluding taxes. They are distinct from the linked provider reference prices. The current catalog applies a service markup; it does not promise to undercut the same model’s official API price.

estimated USD = (input tokens × input rate
               + output tokens × output rate) / 1,000,000

The calculator estimates aggregate workload cost using the displayed base rates. It does not apply caching, batch, off-peak or other special discounts, and those discounts must not be assumed. Billed input and output counts come from the provider response.

Reservation, settlement and reconciliation

Before calling a provider, the relay reserves enough account credit for the configured context bound and requested maximum output. Your available balance may therefore need to exceed the likely final cost. Once valid provider usage arrives, the relay settles the actual charge and releases unused reserved credit.

StatusMeaning
reservedFunds are held while the request is processed.
settledVerified provider usage has been charged. Unused reserved credit has been released.
refundedThe reservation was released after an explicit provider rejection.
pending_reconciliationThe result or usage could not be verified. Funds remain reserved; no final charge has been made.

A successful HTTP 200 can still carry X-Bupt-Billing-Status: pending_reconciliation if the provider did not return usable token counts. The relay does not invent usage or charge the calculator’s estimate as the final bill.

Read your usage

curl https://bupt.ai/v1/usage \
  -H "Authorization: Bearer $BUPT_API_KEY"

The response declares currency: "USD" and units: "micro_usd". Divide money fields by 1,000,000 to convert to USD:

  • account.balance_micro: credit currently available for new requests.
  • account.reserved_micro: credit held for in-flight requests or reconciliation.
  • account.spent_micro: total settled charges.
  • requests: up to 100 recent request records, including model, status and verified token counts when present.

Charges are rounded up to whole microdollars per request. Online top-ups are currently closed. Visit Account & credits to connect your BUPT.AI customer key and review your balance and orders. When enabled, top-ups use Stripe Checkout; credit is added only after the server verifies the payment, never merely because the browser returns from checkout. Operator adjustments require a verified reference and an audit record.

07 / Errors and safe retries

Errors use a JSON error object with a machine-readable code and a human-readable message.

HTTP statusTypical causeNext step
400Unsupported request, invalid parameter or unavailable model.Check the body and your model list.
401Missing or invalid customer key.Verify your BUPT.AI key.
402Insufficient available credit for the reservation.Review balance, output limit and model price.
403Policy acceptance or access restriction.Check the global routing header and account permissions.
409A request already exists for this idempotency key.Inspect usage before attempting a new request.
413 / 415Request too large or incorrect content type.Use JSON within the published request limit.
429Account request rate limit reached.Respect Retry-After.
502 / 503 / 504Provider rejection, uncertain result, unavailable service or timeout.Check the error, billing status and usage before retrying.

For a logical request, you can supply an Idempotency-Key of 8–128 letters, digits, dots, underscores, colons or hyphens. Reusing it returns a duplicate or conflict error and does not replay the completion. Response bodies are not stored for replay.

Use the same key when investigating an uncertain attempt. Do not immediately replace it with a new key: that can create a new, separately billable inference. Contact the operator with the X-Bupt-Request-Id if reconciliation remains pending.

08 / Data handling and routing

The relay records account references, key hashes, request fingerprints, model and provider identifiers, request status, timestamps, token usage, reservations and charges. It does not persist prompt or response bodies in its application ledger or ordinary application logs. Content is transmitted to the provider selected by your model ID.

This is global routing. Accessing the endpoint from Europe or the United States does not mean that all processing, storage or infrastructure is located there. X-Bupt-Data-Policy: global acknowledges that scope; it provides no EU-only or US-only residency guarantee.

Third-party providers have different processing, retention and training policies. The relay’s own decision not to store request bodies is not a promise that upstream providers retain no content or never use it for training. Check the relevant provider terms and your agreed account arrangements before submitting confidential, personal or regulated information.

Data processing arrangements, applicable service eligibility and commercial terms must be confirmed for your use case before activation. No provider-wide zero-retention, uniform no-training or jurisdiction-specific compliance claim is made by this preview.