-
Notifications
You must be signed in to change notification settings - Fork 0
Gen3 Gt Api Runbooks Openai Sdk Curl
github-actions[bot] edited this page May 29, 2026
·
1 revision
Golden-path compatibility: point any OpenAI SDK or curl client at the tenant GT API base URL with a scoped bearer key; model discovery lists published agent aliases and raw-model catalog names allowlisted on the key. Recommended preset: OpenAI-compatible chat client.
This runbook maps OpenAI SDK / curl to GT API routes operators actually publish.
Compatibility: Native OpenAI-compatible · Category: SDK and HTTP
- https://platform.openai.com/docs/api-reference/introduction
- https://github.com/openai/openai-python
- https://github.com/openai/openai-node
-
OPENAI_BASE_URL / baseURL:
https://<tenant-host>/api/tenant -
OPENAI_API_KEY / apiKey:
gtak_... -
model (chat body):
published-agent-alias
| GT route | Verdict | Client integration |
|---|---|---|
GET /v1/models |
native | OpenAI SDK client.models.list() or curl GET {base}/v1/models
|
POST /v1/chat/completions |
native | OpenAI SDK chat.completions.create() or curl POST with JSON body |
POST /v1/embeddings |
native | OpenAI SDK embeddings.create() when key includes inference:embed
|
POST /v1/audio/transcriptions |
native | OpenAI SDK audio.transcriptions.create() with multipart when key includes inference:transcribe
|
POST /v1/audio/speech |
native | OpenAI SDK audio.speech.create() when key includes inference:speech
|
POST /v1/images/generations |
native | OpenAI SDK images.generate() when key includes inference:image
|
POST /v1/conversations/files |
gt_extension | Direct HTTP multipart to /v1/conversations/files with conversation header |
POST /v1/datasets/{id}/files |
gt_extension | Direct HTTP multipart to /v1/datasets/{datasetId}/files
|
GET /v1/files/{id} |
gt_extension | Direct HTTP GET /v1/files/{fileId} polling loop |
None documented for this product.
- Publish at least one inference target (agent alias and/or raw-model catalog entry).
- Create an inference key with the scopes and allowlists the integration needs.
- Set base URL to https:///api/tenant (no trailing slash on the /v1 segment — SDKs append route paths).
- Set
Authorization: Bearer <gtak_...>on every request (SDKs send this viaapi_key/apiKey). - Run
GET /v1/modelsand confirm only intended published names appear. - Send a minimal
POST /v1/chat/completionswith"model": "<published-name>"and one user message.
- Bootstrap GT-managed threads with
POST /v1/conversations, then passX-GT-Conversation-Idon follow-up chat and upload calls. - Upload via
POST /v1/datasets/{id}/filesorPOST /v1/conversations/files; pollGET /v1/files/{id}until status isready.
- Model list matches key allowlists (no leaked unpublished aliases).
- Chat completion succeeds without exposing raw provider model ids.
- Optional: upload + poll reaches
readywhen upload scopes are enabled.
OpenAI SDK / curl runbook
Native OpenAI-compatible · SDK and HTTP
Recommended key preset: OpenAI-compatible chat client
Evidence: deployed E2E verified (OpenAI SDK/curl golden path)
Golden-path compatibility: point any OpenAI SDK or curl client at the tenant GT API base URL with a scoped bearer key; model discovery lists published agent aliases and raw-model catalog names allowlisted on the key.
Official documentation:
- https://platform.openai.com/docs/api-reference/introduction
- https://github.com/openai/openai-python
- https://github.com/openai/openai-node
Configuration fields:
- OPENAI_BASE_URL / baseURL: https://<tenant-host>/api/tenant
- OPENAI_API_KEY / apiKey: gtak_...
- model (chat body): published-agent-alias
GT route mapping:
- GET /v1/models (native): OpenAI SDK `client.models.list()` or curl `GET {base}/v1/models`
- POST /v1/chat/completions (native): OpenAI SDK `chat.completions.create()` or curl POST with JSON body
- POST /v1/embeddings (native): OpenAI SDK `embeddings.create()` when key includes `inference:embed`
- POST /v1/audio/transcriptions (native): OpenAI SDK `audio.transcriptions.create()` with multipart when key includes `inference:transcribe`
- POST /v1/audio/speech (native): OpenAI SDK `audio.speech.create()` when key includes `inference:speech`
- POST /v1/images/generations (native): OpenAI SDK `images.generate()` when key includes `inference:image`
- POST /v1/conversations/files (gt_extension): Direct HTTP multipart to `/v1/conversations/files` with conversation header
- POST /v1/datasets/{id}/files (gt_extension): Direct HTTP multipart to `/v1/datasets/{datasetId}/files`
- GET /v1/files/{id} (gt_extension): Direct HTTP `GET /v1/files/{fileId}` polling loop
Prerequisites:
- Publish at least one inference target (agent alias and/or raw-model catalog entry).
- Create an inference key with the scopes and allowlists the integration needs.
Setup steps:
1. Set base URL to https://<tenant-host>/api/tenant (no trailing slash on the /v1 segment — SDKs append route paths).
2. Set `Authorization: Bearer <gtak_...>` on every request (SDKs send this via `api_key` / `apiKey`).
3. Run `GET /v1/models` and confirm only intended published names appear.
4. Send a minimal `POST /v1/chat/completions` with `"model": "<published-name>"` and one user message.
GT extensions and caveats:
- Bootstrap GT-managed threads with `POST /v1/conversations`, then pass `X-GT-Conversation-Id` on follow-up chat and upload calls.
- Upload via `POST /v1/datasets/{id}/files` or `POST /v1/conversations/files`; poll `GET /v1/files/{id}` until status is `ready`.
Validation checklist:
- Model list matches key allowlists (no leaked unpublished aliases).
- Chat completion succeeds without exposing raw provider model ids.
- Optional: upload + poll reaches `ready` when upload scopes are enabled.