Integrate with the Genesis API¶
Integration moves a model from console experimentation into your application. The console’s Use page brings together Key guidance, the Base URL, an endpoint-by-language code generator, and FAQs. This page summarizes the essential information.
Connection information¶
Item |
Value |
|---|---|
Base URL |
Use the address shown at the top of the console’s Use page. |
Compatible format |
OpenAI API. You can use the official SDK directly: point its |
Authentication¶
The Genesis data API accepts only one authentication method: Authorization: Bearer sk-gsa-v1-.... The credential must be a Genesis API Key issued through a UC service account. The following alternatives are rejected:
An
X-API-KeyheaderA UC Control API Key used to manage account-system APIs
An AI Studio personal access token
A browser login cookie
Send only one credential per request. Locally issued keys also use Authorization: Bearer.
Available endpoints¶
Endpoint |
Method and path |
Purpose |
|---|---|---|
Chat (text) |
|
Text chat and generation |
Chat (multimodal / VLM-OCR) |
|
Mixes |
Responses |
|
OpenAI Responses-compatible endpoint. Supports stateless calls; models on stateful channels can also use |
Messages |
|
Native Anthropic Messages endpoint with Anthropic-shaped requests and responses. Point the official Anthropic SDK’s |
Embeddings (text / multimodal) |
|
Vectorizes text or image-text content for semantic search. Multimodal embeddings require a model with |
Rerank (text / multimodal) |
|
Reranks candidate documents by relevance. Multimodal |
Model list |
|
Lists models available to the current Key, including model ID, type, capability tags, and pricing, for dynamic discovery in code. |
Tip
These are the endpoints currently covered by the code generator on the console’s Use page. OCR, text-to-image, text-to-video, TTS, ASR, and other capabilities can still be tested in Genesis Model Marketplace and the Debug Playground. Refer to the Use-page generator and model details for their call paths and parameters.
Response structures differ by endpoint, but two concepts are shared: the result field (choices[].message.content / data[].embedding / results[] / output[] / content[], depending on the endpoint) and the usage field.
usage is the billing basis for the call (prompt_tokens / completion_tokens / input_tokens / output_tokens / total_tokens). Record it in your monitoring to reconcile against the Usage page.
Streaming calls with stream: true return SSE in the native event format for the relevant ecosystem, such as OpenAI or Anthropic events. The stream ends with data: [DONE] or a termination event.
FAQs¶
What should I do about a 429 rate-limit error? The request rate exceeded the Genesis policy for the service account, such as its RPM limit. Adjust the service-account policy under UC Credential Management, or use exponential-backoff retries for 429 responses. Rate-limit queued batch jobs. If several services share one Key, separate the keys to prevent contention.
How do Chat Completions and Embeddings differ? Chat Completions, including Responses and Messages, generates conversational output. Embeddings creates vectors for semantic search and similarity calculations. Retrieval-augmented generation uses both: Embeddings retrieves, Chat generates, and Rerank can refine the candidates between them.
How do I migrate an existing OpenAI SDK project?
Usually, change only two settings: point base_url to the Genesis connection address and replace api_key with a Genesis Key. The remaining call code stays unchanged.
How is prompt caching billed? Chat models that support caching distinguish normal input, cache creation, and cache-hit input prices. Cache hits are substantially cheaper. See model details for exact prices and use the Usage and Logs pages to verify actual hits. For the complete billing model, see Credit and Billable Items.