vignette/apps/api/engine_gateway/golden/engine_gateway_schema.v1.json
Yun Chan 45b84faa0d
Some checks failed
API contract / OpenAPI type drift (push) Failing after 1m0s
codex·agy OAuth 계정 연결 지원 (ChatGPT/Antigravity 네이티브 어댑터)
omniroute와 동일하게 공개 클라이언트 자격증명으로 서버사이드 OAuth 교환을
제공한다. 관리자가 제공자 로그인 후 브라우저에 남는 code를 붙여넣으면
토큰·refresh token·메타데이터(account-id, Code Assist project)를 저장하고
게이트웨이에 push한다.

- codex_api 어댑터: chatgpt.com/backend-api/codex/responses (Responses SSE,
  401 시 refresh token으로 자가 갱신)
- antigravity_api 어댑터: cloudcode-pa v1internal:streamGenerateContent
  (Gemini 형식 SSE, loadCodeAssist로 프로젝트 발급, 401 자가 갱신)
- 자격증명 저장소에 refresh_token_encrypted·extra 컬럼 추가(부트스트랩
  SQL 포함), 게이트웨이 push가 구조화 자격증명을 전달
2026-09-11 19:01:35 +09:00

377 lines
7.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://vignette.local/schemas/engine_gateway_contract.v1.json",
"title": "EngineGatewayGoldenContract",
"type": "object",
"additionalProperties": false,
"required": [
"version",
"generate_request",
"generate_response",
"stream_frames",
"stream_packets",
"compatibility_lines"
],
"properties": {
"version": {
"const": 1
},
"generate_request": {
"$ref": "#/$defs/GenerateRequest"
},
"generate_response": {
"$ref": "#/$defs/GenerateResponse"
},
"stream_frames": {
"type": "array",
"items": {
"type": "string"
}
},
"stream_packets": {
"type": "array",
"items": {
"$ref": "#/$defs/StreamPacket"
}
},
"compatibility_lines": {
"type": "array",
"items": {
"type": "string"
}
}
},
"$defs": {
"EngineMessage": {
"properties": {
"role": {
"enum": [
"system",
"user",
"assistant"
],
"title": "Role",
"type": "string"
},
"content": {
"title": "Content",
"type": "string"
},
"cache": {
"default": false,
"title": "Cache",
"type": "boolean"
}
},
"required": [
"role",
"content"
],
"title": "EngineMessage",
"type": "object"
},
"GenerateRequest": {
"properties": {
"ai_role": {
"default": "client",
"enum": [
"client",
"counselor",
"evaluator"
],
"title": "Ai Role",
"type": "string"
},
"messages": {
"items": {
"$ref": "#/$defs/EngineMessage"
},
"title": "Messages",
"type": "array"
},
"provider": {
"anyOf": [
{
"enum": [
"claude_cli",
"claude_api",
"codex_cli",
"codex_api",
"agy_cli",
"antigravity_api",
"openai",
"openrouter",
"solar"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Provider"
},
"model": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Model"
},
"reasoning_effort": {
"anyOf": [
{
"enum": [
"low",
"medium",
"high",
"xhigh",
"max",
"ultra"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Reasoning Effort"
},
"max_tokens": {
"default": 1024,
"title": "Max Tokens",
"type": "integer"
},
"temperature": {
"default": 0.7,
"title": "Temperature",
"type": "number"
},
"structured_schema": {
"anyOf": [
{
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Structured Schema"
},
"session_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Session Id"
},
"metadata": {
"title": "Metadata",
"type": "object"
}
},
"required": [
"messages"
],
"title": "GenerateRequest",
"type": "object"
},
"GenerateResponse": {
"properties": {
"text": {
"title": "Text",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
},
"provider": {
"title": "Provider",
"type": "string"
},
"tokens_in": {
"default": 0,
"title": "Tokens In",
"type": "integer"
},
"tokens_out": {
"default": 0,
"title": "Tokens Out",
"type": "integer"
},
"cost_usd": {
"default": 0.0,
"title": "Cost Usd",
"type": "number"
},
"inference_geo": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Inference Geo"
},
"structured": {
"anyOf": [
{
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"title": "Structured"
}
},
"required": [
"text",
"model",
"provider"
],
"title": "GenerateResponse",
"type": "object"
},
"StreamTokenEvent": {
"properties": {
"text": {
"title": "Text",
"type": "string"
}
},
"required": [
"text"
],
"title": "StreamTokenEvent",
"type": "object"
},
"StreamDoneEvent": {
"properties": {
"provider": {
"title": "Provider",
"type": "string"
},
"model": {
"title": "Model",
"type": "string"
},
"tokens_in": {
"default": 0,
"title": "Tokens In",
"type": "integer"
},
"tokens_out": {
"default": 0,
"title": "Tokens Out",
"type": "integer"
},
"cost_usd": {
"default": 0.0,
"title": "Cost Usd",
"type": "number"
},
"turns": {
"default": 0,
"title": "Turns",
"type": "integer"
}
},
"required": [
"provider",
"model"
],
"title": "StreamDoneEvent",
"type": "object"
},
"StreamErrorEvent": {
"properties": {
"detail": {
"title": "Detail",
"type": "string"
}
},
"required": [
"detail"
],
"title": "StreamErrorEvent",
"type": "object"
},
"StreamPacket": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"event",
"payload"
],
"properties": {
"event": {
"const": "token"
},
"payload": {
"$ref": "#/$defs/StreamTokenEvent"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"event",
"payload"
],
"properties": {
"event": {
"const": "done"
},
"payload": {
"$ref": "#/$defs/StreamDoneEvent"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"event",
"payload"
],
"properties": {
"event": {
"const": "error"
},
"payload": {
"$ref": "#/$defs/StreamErrorEvent"
}
}
}
]
}
},
"x-engine-gateway-sse-events": [
"token",
"done",
"error"
],
"x-engine-gateway-default-model-sentinel": "gateway-default"
}