{"openapi":"3.1.0","info":{"title":"TurkServis Member API","version":"1.0.0","description":"Curated public contract for ordinary member credentials."},"servers":[{"url":"https://ai.turkservis.online"}],"tags":[{"name":"AI"},{"name":"Research"},{"name":"MCP"},{"name":"Downloads"}],"paths":{"/v1/capabilities":{"get":{"summary":"Discover available media capabilities and exact model IDs","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Capabilities"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/media/run":{"post":{"summary":"Generate media using the member account","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaRequest"}}}}}},"/v1/images/generations":{"post":{"summary":"Generate an image","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"prompt":{"type":"string"},"n":{"type":"integer","minimum":1}},"required":["model","prompt"]}}}}}},"/v1/videos/generations":{"post":{"summary":"Generate video when a video model is available","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"prompt":{"type":"string"},"duration_seconds":{"type":"integer"}},"required":["model","prompt"]}}}}}},"/v1/audio/speech":{"post":{"summary":"Convert text to speech","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"audio/mpeg":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"input":{"type":"string"},"voice":{"type":"string"}},"required":["model","input"]}}}}}},"/v1/audio/transcriptions":{"post":{"summary":"Transcribe uploaded audio","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"model":{"type":"string"},"file":{"type":"string","format":"binary"},"language":{"type":"string"}},"required":["model","file"]}}}}}},"/v1/embeddings":{"post":{"summary":"Embed text using the configured embedding service","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["input"]}}}}}},"/v1/search":{"post":{"summary":"Search the web with a web_search capability model; billed per successful request","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"query":{"type":"string","minLength":1,"maxLength":500},"max_results":{"type":"integer","minimum":1,"maximum":10},"search_type":{"type":"string","enum":["web","news"]}},"required":["query"]}}}}}},"/v1/web/fetch":{"post":{"summary":"Read one web page with a web_fetch capability model; billed per successful request","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"model":{"type":"string"},"url":{"type":"string","format":"uri","maxLength":2048},"format":{"type":"string","enum":["markdown","html"]}},"required":["url"]}}}}}},"/v1/models":{"get":{"summary":"List member models","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/router/catalog":{"get":{"summary":"Read live managed 9Router teams and passive status","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouterCatalog"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/chat/completions":{"post":{"summary":"Create a chat completion","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}},"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"type\":\"response.completed\"}\n\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}}}}},"/v1/responses":{"post":{"summary":"Create a Responses API result","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesResponse"}},"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"type\":\"response.completed\"}\n\n"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesRequest"}}}}}},"/v1/me":{"get":{"summary":"Read account usage","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}}}},"/v1/research/jobs":{"post":{"summary":"Start a source-grounded research job","security":[{"BearerAuth":[]}],"responses":{"202":{"description":"Research job accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchJob"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchJobRequest"}}}}}},"/v1/research/jobs/{job_id}":{"get":{"summary":"Read a tenant-bound research job","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResearchJob"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","pattern":"^rj_"}}]}},"/mcp":{"post":{"summary":"Call the public Streamable HTTP MCP service","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"$ref":"#/components/responses/Unavailable"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}}}},"/downloads/manifest.json":{"get":{"summary":"Read the current signed-off release manifest","security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseManifest"}}}},"404":{"description":"Release manifest unavailable."}}}},"/downloads/{version}/{filename}":{"get":{"summary":"Download an immutable release artifact","security":[],"parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string"}},{"name":"filename","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Verified artifact bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"404":{"description":"Artifact not found or failed verification."}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"TurkServis API key"}},"schemas":{"Capabilities":{"type":"object","required":["schema_version","capabilities"],"properties":{"schema_version":{"type":"integer"},"capabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"endpoint":{"type":"string"},"status":{"enum":["available","unavailable","unknown"]},"models":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}}}}}}},"MediaRequest":{"type":"object","required":["capability","model"],"properties":{"capability":{"enum":["image","video","tts","stt"]},"model":{"type":"string"},"text":{"type":"string","maxLength":12000},"voice":{"type":"string"},"seconds":{"type":"integer","minimum":1,"maximum":15},"audio_base64":{"type":"string","contentEncoding":"base64"},"filename":{"type":"string"}}},"MediaResponse":{"type":"object","properties":{"capability":{"type":"string"},"model":{"type":"string"},"result":{"type":"object"},"media_type":{"type":"string"},"data_base64":{"type":"string","contentEncoding":"base64"}}},"Error":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}},"additionalProperties":true},"Model":{"type":"object","required":["id","object","owned_by"],"properties":{"id":{"type":"string"},"object":{"const":"model"},"owned_by":{"type":"string"},"description":{"type":"string"}},"additionalProperties":false},"ModelList":{"type":"object","required":["object","data"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Model"}}},"additionalProperties":false},"RouterCatalog":{"type":"object","required":["schema_version","generated_at","stale","source","models"],"properties":{"schema_version":{"const":1},"generated_at":{"type":"string","format":"date-time"},"stale":{"type":"boolean"},"source":{"type":"string","enum":["control_plane","public_models","model_snapshot","configured_inventory"]},"models":{"type":"array","items":{"type":"object"}}},"additionalProperties":false},"ChatMessage":{"type":"object","required":["role","content"],"properties":{"role":{"type":"string","enum":["system","developer","user","assistant"]},"content":{"type":"string"}},"additionalProperties":false},"ChatRequest":{"type":"object","required":["model","messages"],"properties":{"model":{"type":"string"},"messages":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/ChatMessage"}},"stream":{"type":"boolean","default":false},"max_tokens":{"type":"integer","minimum":1}},"additionalProperties":true},"Usage":{"type":"object","properties":{"prompt_tokens":{"type":"integer"},"completion_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"additionalProperties":true},"ChatResponse":{"type":"object","required":["id","object","model","choices"],"properties":{"id":{"type":"string"},"object":{"type":"string"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object"}},"usage":{"$ref":"#/components/schemas/Usage"}},"additionalProperties":true},"ResponsesRequest":{"type":"object","required":["model","input"],"properties":{"model":{"type":"string"},"input":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"object"}}]},"instructions":{"type":"string"},"stream":{"type":"boolean","default":false},"max_output_tokens":{"type":"integer","minimum":1}},"additionalProperties":true},"ResponsesResponse":{"type":"object","required":["id","object","status","model","output"],"properties":{"id":{"type":"string"},"object":{"const":"response"},"status":{"type":"string"},"model":{"type":"string"},"output":{"type":"array","items":{"type":"object"}},"output_text":{"type":"string"},"usage":{"type":["object","null"]}},"additionalProperties":true},"Account":{"type":"object","properties":{"is_master":{"type":"boolean"},"balance_cents":{"type":"integer"},"reserved_cents":{"type":"integer"},"today_requests":{"type":"integer"},"month_requests":{"type":"integer"},"month_tokens":{"type":"integer"}},"additionalProperties":false},"ResearchJobRequest":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1},"depth":{"type":"string","enum":["quick","standard","deep"]},"freshness_days":{"type":"integer","minimum":1},"domains":{"type":"array","items":{"type":"string"}},"context":{"type":"string","description":"Explicit text context only"}},"additionalProperties":false},"ResearchJob":{"type":"object","required":["job_id","status"],"properties":{"job_id":{"type":"string","pattern":"^rj_"},"status":{"type":"string","enum":["queued","running","succeeded","failed","expired"]},"progress":{"type":"integer","minimum":0,"maximum":100},"result":{"type":["object","null"]},"error":{"type":["string","null"]}},"additionalProperties":true},"JsonRpcRequest":{"type":"object","required":["jsonrpc","method"],"properties":{"jsonrpc":{"const":"2.0"},"id":{},"method":{"type":"string"},"params":{"type":"object"}},"additionalProperties":false},"JsonRpcResponse":{"type":"object","required":["jsonrpc"],"properties":{"jsonrpc":{"const":"2.0"},"id":{},"result":{},"error":{"type":"object"}},"additionalProperties":false},"ReleaseManifest":{"type":"object","required":["schema_version","product","version","published_at","unsigned","artifacts"],"properties":{"schema_version":{"const":1},"product":{"const":"turkservis-cli"},"version":{"type":"string"},"published_at":{"type":"string","format":"date-time"},"unsigned":{"type":"boolean"},"artifacts":{"type":"array","items":{"type":"object"}}},"additionalProperties":true}},"responses":{"BadRequest":{"description":"The request is invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unauthorized":{"description":"A valid bearer token is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"PaymentRequired":{"description":"Balance or quota is insufficient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"The member is not allowed to use this operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"The request rate limit was reached.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Unavailable":{"description":"A required provider or service is unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}