openapi: 3.0.0 info: contact: email: api-team@confluent.io name: API Team url: https://confluent.slack.com/app_redirect?channel=api-eng description: API for interacting with AI models from within Confluent Cloud. title: AI API version: 0.0.1 x-api-id: 90b4b229-3ea5-4e00-99f4-62be3f2cced2 x-api-group: ai/v1 x-audience: component-internal x-tag-group: AI API (%s) servers: - description: Confluent Cloud production url: https://api.confluent.cloud tags: - description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Query the Confluent AI assistant, optionally with prior conversation history. name: Chat Completions (ai/v1) - description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+docs-ai-v1-early-access@confluent.io?subject=Request%20to%20join%20docs-ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20docs-ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Query the Docs AI assistant, optionally with prior conversation history. name: Doc Completions (docs-ai/v1) - description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Submit feedback on the AI assistant. name: Feedbacks (ai/v1) - description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Enable the Confluent AI Assistant for your organization. This operation is only available to users with the `OrganizationAdmin` role. By default, this setting is set to `True`. ## The Org Preferences Model name: Org Preferences (ai/v1) - description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Returns '{ ai_assistant_enabled: true|false}' based on if the Confluent AI Assistant is enabled for your organization. ## The Availabilities Model name: Availabilities (ai/v1) paths: /ai/v1/chat-completions: options: description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Get the HTTP methods/verbs (if any) the particular authenticated user is allowed to submit operationId: getAiV1ChatCompletion responses: "204": description: Query was successful. "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Read a Chat Completion tags: - Chat Completions (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request OPTIONS \ --url https://api.confluent.cloud/ai/v1/chat-completions \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/chat-completions") .method("OPTIONS", null) .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\ \n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/chat-completions\"\ \n\n\treq, _ := http.NewRequest(\"OPTIONS\", url, nil)\n\n\treq.Header.Add(\"\ Authorization\", \"Basic REPLACE_BASIC_AUTH\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\ \n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\t\ fmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("OPTIONS", "/ai/v1/chat-completions", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "OPTIONS", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/chat-completions", "headers": { "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "OPTIONS"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/chat-completions"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/chat-completions"); var request = new RestRequest(Method.OPTIONS); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); IRestResponse response = client.Execute(request); post: description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Query the Confluent AI assistant, optionally with prior conversation history. operationId: queryAiV1ChatCompletion requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsRequest' - required: - question type: object responses: "200": content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsReply' - required: - ai_session_id - answer - api_version - id - kind - question type: object description: Query was successful. "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Query a Chat Completion tags: - Chat Completions (ai/v1) x-request-access-name: AI API v1 x-name: ai.v1.ChatCompletions x-codeSamples: - lang: Shell source: |- curl --request POST \ --url https://api.confluent.cloud/ai/v1/chat-completions \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' \ --header 'content-type: application/json' \ --data '{"ai_session_id":"cd2ec6a3-82fe-4911-902a-065ff8425b66","question":"What is my most expensive Kafka cluster?","drift_enabled":false,"history":[{"question":"What is my most expensive Kafka cluster?","answer":"Your most expensive Kafka cluster is \"lkc-12345\"."}]}' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}"); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/chat-completions") .post(body) .addHeader("content-type", "application/json") .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\ \n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/chat-completions\"\ \n\n\tpayload := strings.NewReader(\"{\\\"ai_session_id\\\":\\\"cd2ec6a3-82fe-4911-902a-065ff8425b66\\\ \",\\\"question\\\":\\\"What is my most expensive Kafka cluster?\\\",\\\"\ drift_enabled\\\":false,\\\"history\\\":[{\\\"question\\\":\\\"What is my\ \ most expensive Kafka cluster?\\\",\\\"answer\\\":\\\"Your most expensive\ \ Kafka cluster is \\\\\\\"lkc-12345\\\\\\\".\\\"}]}\")\n\n\treq, _ := http.NewRequest(\"\ POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\"\ )\n\treq.Header.Add(\"Authorization\", \"Basic REPLACE_BASIC_AUTH\")\n\n\ \tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody,\ \ _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\ \n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") payload = "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}" headers = { 'content-type': "application/json", 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("POST", "/ai/v1/chat-completions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "POST", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/chat-completions", "headers": { "content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ ai_session_id: 'cd2ec6a3-82fe-4911-902a-065ff8425b66', question: 'What is my most expensive Kafka cluster?', drift_enabled: false, history: [ { question: 'What is my most expensive Kafka cluster?', answer: 'Your most expensive Kafka cluster is "lkc-12345".' } ] })); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/chat-completions"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}"); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/chat-completions"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); request.AddParameter("application/json", "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 /docs-ai/v1/doc-completions: post: description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+docs-ai-v1-early-access@confluent.io?subject=Request%20to%20join%20docs-ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20docs-ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Query the Docs AI assistant, optionally with prior conversation history. operationId: queryDocsAiV1DocCompletion requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsRequest' - required: - question type: object responses: "200": content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsReply' - required: - ai_session_id - answer - api_version - id - kind - question type: object description: Query was successful. "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple summary: Query a Doc Completion tags: - Doc Completions (docs-ai/v1) x-request-access-name: AI API v1 x-name: docs-ai.v1.DocCompletions x-codeSamples: - lang: Shell source: |- curl --request POST \ --url https://api.confluent.cloud/docs-ai/v1/doc-completions \ --header 'content-type: application/json' \ --data '{"ai_session_id":"cd2ec6a3-82fe-4911-902a-065ff8425b66","question":"What is my most expensive Kafka cluster?","drift_enabled":false,"history":[{"question":"What is my most expensive Kafka cluster?","answer":"Your most expensive Kafka cluster is \"lkc-12345\"."}]}' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}"); Request request = new Request.Builder() .url("https://api.confluent.cloud/docs-ai/v1/doc-completions") .post(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\ \n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/docs-ai/v1/doc-completions\"\ \n\n\tpayload := strings.NewReader(\"{\\\"ai_session_id\\\":\\\"cd2ec6a3-82fe-4911-902a-065ff8425b66\\\ \",\\\"question\\\":\\\"What is my most expensive Kafka cluster?\\\",\\\"\ drift_enabled\\\":false,\\\"history\\\":[{\\\"question\\\":\\\"What is my\ \ most expensive Kafka cluster?\\\",\\\"answer\\\":\\\"Your most expensive\ \ Kafka cluster is \\\\\\\"lkc-12345\\\\\\\".\\\"}]}\")\n\n\treq, _ := http.NewRequest(\"\ POST\", url, payload)\n\n\treq.Header.Add(\"content-type\", \"application/json\"\ )\n\n\tres, _ := http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\ \tbody, _ := ioutil.ReadAll(res.Body)\n\n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\ \n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") payload = "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}" headers = { 'content-type': "application/json" } conn.request("POST", "/docs-ai/v1/doc-completions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "POST", "hostname": "api.confluent.cloud", "port": null, "path": "/docs-ai/v1/doc-completions", "headers": { "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ ai_session_id: 'cd2ec6a3-82fe-4911-902a-065ff8425b66', question: 'What is my most expensive Kafka cluster?', drift_enabled: false, history: [ { question: 'What is my most expensive Kafka cluster?', answer: 'Your most expensive Kafka cluster is "lkc-12345".' } ] })); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/docs-ai/v1/doc-completions"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "content-type: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}"); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/docs-ai/v1/doc-completions"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"question\":\"What is my most expensive Kafka cluster?\",\"drift_enabled\":false,\"history\":[{\"question\":\"What is my most expensive Kafka cluster?\",\"answer\":\"Your most expensive Kafka cluster is \\\"lkc-12345\\\".\"}]}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 /ai/v1/chat-completions/{chat_completion_id}/feedback: post: description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Submit feedback on the Confluent AI assistant. operationId: createAiV1ChatCompletionFeedback parameters: - description: The Chat Completion explode: false in: path name: chat_completion_id required: true schema: type: string style: simple requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.Feedback' - required: - ai_session_id type: object responses: "204": description: No Content "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "409": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "409" code: resource_already_exists title: Resource Already exists detail: The entitlement '91e3e86f-fca6-4f14-98f5-a48e64113ce2' already exists. schema: $ref: '#/components/schemas/Failure' description: The request is in conflict with the current server state headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple Location: description: Resource URI of conflicting resource explode: false schema: example: https://api.confluent.cloud/{object}/{id} format: uri type: string style: simple x-summary: Conflict "422": content: application/json: example: errors: - status: "422" code: invalid_configuration id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d title: Validation Failed detail: 'The property ''/cluster/storage_size'' of type string did not match the following type: integer' source: pointer: /cluster/storage_size schema: $ref: '#/components/schemas/Failure' description: Validation Failed headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Create a Feedback tags: - Feedbacks (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request POST \ --url 'https://api.confluent.cloud/ai/v1/chat-completions/{chat_completion_id}/feedback' \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' \ --header 'content-type: application/json' \ --data '{"ai_session_id":"cd2ec6a3-82fe-4911-902a-065ff8425b66","reaction":"UNSPECIFIED","copied":"UNSPECIFIED","comment":"The suggested CLI command contained several typos. It was supposed to be \"confluent\" instead of \"ccloud\"."}' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}"); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/chat-completions/{chat_completion_id}/feedback") .post(body) .addHeader("content-type", "application/json") .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\ \n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/chat-completions/{chat_completion_id}/feedback\"\ \n\n\tpayload := strings.NewReader(\"{\\\"ai_session_id\\\":\\\"cd2ec6a3-82fe-4911-902a-065ff8425b66\\\ \",\\\"reaction\\\":\\\"UNSPECIFIED\\\",\\\"copied\\\":\\\"UNSPECIFIED\\\ \",\\\"comment\\\":\\\"The suggested CLI command contained several typos.\ \ It was supposed to be \\\\\\\"confluent\\\\\\\" instead of \\\\\\\"ccloud\\\ \\\\\".\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\ \n\treq.Header.Add(\"content-type\", \"application/json\")\n\treq.Header.Add(\"\ Authorization\", \"Basic REPLACE_BASIC_AUTH\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\ \n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\t\ fmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") payload = "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}" headers = { 'content-type': "application/json", 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("POST", "/ai/v1/chat-completions/{chat_completion_id}/feedback", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "POST", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/chat-completions/{chat_completion_id}/feedback", "headers": { "content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ ai_session_id: 'cd2ec6a3-82fe-4911-902a-065ff8425b66', reaction: 'UNSPECIFIED', copied: 'UNSPECIFIED', comment: 'The suggested CLI command contained several typos. It was supposed to be "confluent" instead of "ccloud".' })); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/chat-completions/{chat_completion_id}/feedback"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}"); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/chat-completions/{chat_completion_id}/feedback"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); request.AddParameter("application/json", "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 /docs-ai/v1/doc-completions/{doc_completion_id}/feedback: post: description: |- [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Submit feedback on the Doc AI assistant. operationId: createAiV1DocCompletionFeedback parameters: - description: The Doc Completion explode: false in: path name: doc_completion_id required: true schema: type: string style: simple requestBody: content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.Feedback' - required: - ai_session_id type: object responses: "204": description: No Content "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "409": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "409" code: resource_already_exists title: Resource Already exists detail: The entitlement '91e3e86f-fca6-4f14-98f5-a48e64113ce2' already exists. schema: $ref: '#/components/schemas/Failure' description: The request is in conflict with the current server state headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple Location: description: Resource URI of conflicting resource explode: false schema: example: https://api.confluent.cloud/{object}/{id} format: uri type: string style: simple x-summary: Conflict "422": content: application/json: example: errors: - status: "422" code: invalid_configuration id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d title: Validation Failed detail: 'The property ''/cluster/storage_size'' of type string did not match the following type: integer' source: pointer: /cluster/storage_size schema: $ref: '#/components/schemas/Failure' description: Validation Failed headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple summary: Create a Feedback tags: - Feedbacks (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request POST \ --url 'https://api.confluent.cloud/docs-ai/v1/doc-completions/{doc_completion_id}/feedback' \ --header 'content-type: application/json' \ --data '{"ai_session_id":"cd2ec6a3-82fe-4911-902a-065ff8425b66","reaction":"UNSPECIFIED","copied":"UNSPECIFIED","comment":"The suggested CLI command contained several typos. It was supposed to be \"confluent\" instead of \"ccloud\"."}' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}"); Request request = new Request.Builder() .url("https://api.confluent.cloud/docs-ai/v1/doc-completions/{doc_completion_id}/feedback") .post(body) .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\ \n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/docs-ai/v1/doc-completions/{doc_completion_id}/feedback\"\ \n\n\tpayload := strings.NewReader(\"{\\\"ai_session_id\\\":\\\"cd2ec6a3-82fe-4911-902a-065ff8425b66\\\ \",\\\"reaction\\\":\\\"UNSPECIFIED\\\",\\\"copied\\\":\\\"UNSPECIFIED\\\ \",\\\"comment\\\":\\\"The suggested CLI command contained several typos.\ \ It was supposed to be \\\\\\\"confluent\\\\\\\" instead of \\\\\\\"ccloud\\\ \\\\\".\\\"}\")\n\n\treq, _ := http.NewRequest(\"POST\", url, payload)\n\ \n\treq.Header.Add(\"content-type\", \"application/json\")\n\n\tres, _ :=\ \ http.DefaultClient.Do(req)\n\n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\ \n\tfmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") payload = "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}" headers = { 'content-type': "application/json" } conn.request("POST", "/docs-ai/v1/doc-completions/{doc_completion_id}/feedback", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "POST", "hostname": "api.confluent.cloud", "port": null, "path": "/docs-ai/v1/doc-completions/{doc_completion_id}/feedback", "headers": { "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ ai_session_id: 'cd2ec6a3-82fe-4911-902a-065ff8425b66', reaction: 'UNSPECIFIED', copied: 'UNSPECIFIED', comment: 'The suggested CLI command contained several typos. It was supposed to be "confluent" instead of "ccloud".' })); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/docs-ai/v1/doc-completions/{doc_completion_id}/feedback"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "content-type: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}"); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/docs-ai/v1/doc-completions/{doc_completion_id}/feedback"); var request = new RestRequest(Method.POST); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"ai_session_id\":\"cd2ec6a3-82fe-4911-902a-065ff8425b66\",\"reaction\":\"UNSPECIFIED\",\"copied\":\"UNSPECIFIED\",\"comment\":\"The suggested CLI command contained several typos. It was supposed to be \\\"confluent\\\" instead of \\\"ccloud\\\".\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 /ai/v1/org-preferences: get: description: | [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Returns the organization's ai-assistant setting in org-preferences. operationId: getAiV1OrgPreference responses: "200": content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.OrgPreferences' - required: - ai_assistant_enabled - api_version - kind type: object description: Org Preferences. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Read the organization's ai-assistant setting in org-preferences. tags: - Org Preferences (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request GET \ --url https://api.confluent.cloud/ai/v1/org-preferences \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/org-preferences") .get() .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\ \n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/org-preferences\"\ \n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"\ Authorization\", \"Basic REPLACE_BASIC_AUTH\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\ \n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\t\ fmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("GET", "/ai/v1/org-preferences", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "GET", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/org-preferences", "headers": { "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/org-preferences"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/org-preferences"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); IRestResponse response = client.Execute(request); patch: description: |+ [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Updates the organization's ai-assistant setting in org-preferences. operationId: updateAiV1OrgPreference requestBody: content: application/json: schema: $ref: '#/components/schemas/ai.v1.OrgPreferences' responses: "200": content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.OrgPreferences' - required: - ai_assistant_enabled - api_version - kind type: object description: Org Preferences. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "409": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "409" code: resource_already_exists title: Resource Already exists detail: The entitlement '91e3e86f-fca6-4f14-98f5-a48e64113ce2' already exists. schema: $ref: '#/components/schemas/Failure' description: The request is in conflict with the current server state headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple Location: description: Resource URI of conflicting resource explode: false schema: example: https://api.confluent.cloud/{object}/{id} format: uri type: string style: simple x-summary: Conflict "422": content: application/json: example: errors: - status: "422" code: invalid_configuration id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d title: Validation Failed detail: 'The property ''/cluster/storage_size'' of type string did not match the following type: integer' source: pointer: /cluster/storage_size schema: $ref: '#/components/schemas/Failure' description: Validation Failed headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Set the organization's ai-assistant setting in org-preferences. tags: - Org Preferences (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request PATCH \ --url https://api.confluent.cloud/ai/v1/org-preferences \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' \ --header 'content-type: application/json' \ --data '{"ai_assistant_enabled":true}' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"ai_assistant_enabled\":true}"); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/org-preferences") .patch(body) .addHeader("content-type", "application/json") .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"net/http\"\ \n\t\"io/ioutil\"\n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/org-preferences\"\ \n\n\tpayload := strings.NewReader(\"{\\\"ai_assistant_enabled\\\":true}\"\ )\n\n\treq, _ := http.NewRequest(\"PATCH\", url, payload)\n\n\treq.Header.Add(\"\ content-type\", \"application/json\")\n\treq.Header.Add(\"Authorization\"\ , \"Basic REPLACE_BASIC_AUTH\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\ \n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\t\ fmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") payload = "{\"ai_assistant_enabled\":true}" headers = { 'content-type': "application/json", 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("PATCH", "/ai/v1/org-preferences", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "PATCH", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/org-preferences", "headers": { "content-type": "application/json", "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({ai_assistant_enabled: true})); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/org-preferences"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"ai_assistant_enabled\":true}"); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/org-preferences"); var request = new RestRequest(Method.PATCH); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); request.AddParameter("application/json", "{\"ai_assistant_enabled\":true}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 /ai/v1/availability: get: description: | [![Early Access](https://img.shields.io/badge/Lifecycle%20Stage-Early%20Access-%2345c6e8)](#section/Versioning/API-Lifecycle-Policy) [![Request Access To AI API v1](https://img.shields.io/badge/-Request%20Access%20To%20AI%20API%20v1-%23bc8540)](mailto:ccloud-api-access+ai-v1-early-access@confluent.io?subject=Request%20to%20join%20ai/v1%20API%20Early%20Access&body=I%E2%80%99d%20like%20to%20join%20the%20Confluent%20Cloud%20API%20Early%20Access%20for%20ai/v1%20to%20provide%20early%20feedback%21%20My%20Cloud%20Organization%20ID%20is%20%3Cretrieve%20from%20https%3A//confluent.cloud/settings/billing/payment%3E.) Returns the organization's ai-assistant setting. operationId: getAiV1Availability responses: "200": content: application/json: schema: allOf: - $ref: '#/components/schemas/ai.v1.Availability' - required: - ai_assistant_enabled - api_version - kind type: object description: Availability. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple "400": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "401": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized "403": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden "404": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple "429": description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and\ \ Twitter's same-named header which uses UTC epoch seconds. We use\ \ relative time to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple "500": content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple security: - cloud-api-key: [] summary: Read the organization's ai-assistant setting. tags: - Availabilities (ai/v1) x-request-access-name: AI API v1 x-codeSamples: - lang: Shell source: |- curl --request GET \ --url https://api.confluent.cloud/ai/v1/availability \ --header 'Authorization: Basic REPLACE_BASIC_AUTH' - lang: Java source: |- OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("https://api.confluent.cloud/ai/v1/availability") .get() .addHeader("Authorization", "Basic REPLACE_BASIC_AUTH") .build(); Response response = client.newCall(request).execute(); - lang: Go source: "package main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"io/ioutil\"\ \n)\n\nfunc main() {\n\n\turl := \"https://api.confluent.cloud/ai/v1/availability\"\ \n\n\treq, _ := http.NewRequest(\"GET\", url, nil)\n\n\treq.Header.Add(\"\ Authorization\", \"Basic REPLACE_BASIC_AUTH\")\n\n\tres, _ := http.DefaultClient.Do(req)\n\ \n\tdefer res.Body.Close()\n\tbody, _ := ioutil.ReadAll(res.Body)\n\n\t\ fmt.Println(res)\n\tfmt.Println(string(body))\n\n}" - lang: Python source: |- import http.client conn = http.client.HTTPSConnection("api.confluent.cloud") headers = { 'Authorization': "Basic REPLACE_BASIC_AUTH" } conn.request("GET", "/ai/v1/availability", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) - lang: Node source: |- const http = require("https"); const options = { "method": "GET", "hostname": "api.confluent.cloud", "port": null, "path": "/ai/v1/availability", "headers": { "Authorization": "Basic REPLACE_BASIC_AUTH" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.end(); - lang: C source: |- CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.confluent.cloud/ai/v1/availability"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "Authorization: Basic REPLACE_BASIC_AUTH"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd); - lang: C# source: |- var client = new RestClient("https://api.confluent.cloud/ai/v1/availability"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Basic REPLACE_BASIC_AUTH"); IRestResponse response = client.Execute(request); x-request-access-name: AI API v1 components: responses: BadRequestError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "400" code: invalid_filter title: Invalid Filter detail: The 'delorean' resource can't be filtered by 'num_doors' source: parameter: num_doors schema: $ref: '#/components/schemas/Failure' description: Bad Request headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple UnauthenticatedError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "401" code: user_unauthenticated title: Authentication Required detail: Valid authentication credentials must be provided schema: $ref: '#/components/schemas/Failure' description: The request lacks valid authentication credentials for this resource. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple WWW-Authenticate: description: The unique identifier for the API request. example: Basic error="invalid_key", error_description="The API Key is invalid" explode: false schema: type: string style: simple x-summary: Unauthorized OverQuotaError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "402" code: quota_exceeded title: Kafka Clusters Per Org Quota Exceeded detail: 'The request would exceed the quota: kafka_clusters_per_environment' schema: $ref: '#/components/schemas/Failure' description: The request would exceed one or more quotas. headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Over Quota UnauthorizedError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "403" code: user_unauthorized title: User Access Unauthorized detail: The user 'mcfly' is not allowed to access the 'delorean' resource without the 'plutonium' role. schema: $ref: '#/components/schemas/Failure' description: The access credentials were considered insufficient to grant access headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple x-summary: Forbidden ConflictError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "409" code: resource_already_exists title: Resource Already exists detail: The entitlement '91e3e86f-fca6-4f14-98f5-a48e64113ce2' already exists. schema: $ref: '#/components/schemas/Failure' description: The request is in conflict with the current server state headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple Location: description: Resource URI of conflicting resource explode: false schema: example: https://api.confluent.cloud/{object}/{id} format: uri type: string style: simple x-summary: Conflict NotFoundError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "404" title: Not Found schema: $ref: '#/components/schemas/Failure' description: Not Found headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple ValidationError: content: application/json: example: errors: - status: "422" code: invalid_configuration id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d title: Validation Failed detail: 'The property ''/cluster/storage_size'' of type string did not match the following type: integer' source: pointer: /cluster/storage_size schema: $ref: '#/components/schemas/Failure' description: Validation Failed headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple RateLimitError: description: Rate Limit Exceeded headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple X-RateLimit-Limit: description: The maximum number of requests you're permitted to make per time period. explode: false schema: type: integer style: simple X-RateLimit-Remaining: description: The number of requests remaining in the current rate limit window. explode: false schema: type: integer style: simple X-RateLimit-Reset: description: "The relative time in seconds until the current rate-limit\ \ window resets. \n \n**Important:** This differs from Github and Twitter's\ \ same-named header which uses UTC epoch seconds. We use relative time\ \ to avoid client/server time synchronization issues." explode: false schema: type: integer style: simple Retry-After: description: The number of seconds to wait until the rate limit window resets. Only sent when the rate limit is reached. explode: false schema: type: integer style: simple DefaultSystemError: content: application/json: example: errors: - id: ed42afdc-f0d5-4c0d-b428-9fc6ed6e279d status: "500" code: out_of_gas title: DeLorean Out Of Gas detail: The DeLorean has run out of gas, but Doc Brown will fill 'er up for you asap schema: $ref: '#/components/schemas/Failure' description: Oops, something went wrong! headers: X-Request-Id: description: The unique identifier for the API request. explode: false schema: type: string style: simple schemas: ai.v1.OrgPreferences: description: |- Enable the Confluent AI Assistant for your organization. This operation is only available to users with the `OrganizationAdmin` role. By default, this setting is set to `True`. ## The Org Preferences Model properties: api_version: description: APIVersion defines the schema version of this representation of a resource. enum: - ai/v1 readOnly: true type: string kind: description: Kind defines the object this REST resource represents. enum: - OrgPreferences readOnly: true type: string ai_assistant_enabled: description: Enable ai-assist for the organization type: boolean type: object ai.v1.Availability: description: | Returns '{ ai_assistant_enabled: true|false}' based on if the Confluent AI Assistant is enabled for your organization. properties: api_version: description: APIVersion defines the schema version of this representation of a resource. enum: - ai/v1 readOnly: true type: string kind: description: Kind defines the object this REST resource represents. enum: - Availability readOnly: true type: string ai_assistant_enabled: description: Enabled ai-assist for the organization type: boolean type: object ai.v1.ChatCompletionsRequest: description: Request to the AI assistant. properties: api_version: description: APIVersion defines the schema version of this representation of a resource. enum: - ai/v1 readOnly: true type: string kind: description: Kind defines the object this REST resource represents. enum: - ChatCompletionsRequest readOnly: true type: string id: description: ID is the "natural identifier" for an object within its scope/namespace; it is normally unique across time but not space. That is, you can assume that the ID will not be reclaimed and reused after an object is deleted ("time"); however, it may collide with IDs for other object `kinds` or objects of the same `kind` within a different scope/namespace ("space"). example: dlz-f3a90de maxLength: 255 readOnly: true type: string metadata: allOf: - $ref: '#/components/schemas/ObjectMeta' - properties: self: example: https://api.confluent.cloud/ai/v1/chat-completions-requests/ccr-12345 resource_name: example: crn://confluent.cloud/organization=9bb441c4-edef-46ac-8a41-c49e44a3fd9a/chat-completions-request=ccr-12345 ai_session_id: allOf: - $ref: '#/components/schemas/ai.v1.SessionId' question: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsQuestion' drift_enabled: allOf: - $ref: '#/components/schemas/ai.v1.DriftEnabled' history: description: Completion objects from previous interactions. items: $ref: '#/components/schemas/ai.v1.ChatCompletionsHistory' maxItems: 5 type: array type: object ai.v1.ChatCompletionsReply: description: Reply from the AI assistant. properties: api_version: description: APIVersion defines the schema version of this representation of a resource. enum: - ai/v1 readOnly: true type: string kind: description: Kind defines the object this REST resource represents. enum: - ChatCompletionsReply readOnly: true type: string id: description: ID is the "natural identifier" for an object within its scope/namespace; it is normally unique across time but not space. That is, you can assume that the ID will not be reclaimed and reused after an object is deleted ("time"); however, it may collide with IDs for other object `kinds` or objects of the same `kind` within a different scope/namespace ("space"). example: dlz-f3a90de maxLength: 255 readOnly: true type: string metadata: allOf: - $ref: '#/components/schemas/ObjectMeta' - properties: self: example: https://api.confluent.cloud/ai/v1/chat-completions-replies/ccr-12345 resource_name: example: crn://confluent.cloud/organization=9bb441c4-edef-46ac-8a41-c49e44a3fd9a/chat-completions-reply=ccr-12345 ai_session_id: allOf: - $ref: '#/components/schemas/ai.v1.SessionId' answer: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsAnswer' question: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsQuestion' type: object ai.v1.Feedback: description: Submit feedback on the AI assistant. properties: api_version: description: APIVersion defines the schema version of this representation of a resource. enum: - ai/v1 readOnly: true type: string kind: description: Kind defines the object this REST resource represents. enum: - Feedback readOnly: true type: string id: description: ID is the "natural identifier" for an object within its scope/namespace; it is normally unique across time but not space. That is, you can assume that the ID will not be reclaimed and reused after an object is deleted ("time"); however, it may collide with IDs for other object `kinds` or objects of the same `kind` within a different scope/namespace ("space"). example: dlz-f3a90de maxLength: 255 readOnly: true type: string metadata: allOf: - $ref: '#/components/schemas/ObjectMeta' - properties: self: example: https://api.confluent.cloud/ai/v1/feedbacks/f-12345 resource_name: example: crn://confluent.cloud/organization=9bb441c4-edef-46ac-8a41-c49e44a3fd9a/feedback=f-12345 ai_session_id: allOf: - $ref: '#/components/schemas/ai.v1.SessionId' reaction: default: UNSPECIFIED description: | The feedback reaction types are: 'THUMBS_UP': when a user upvotes AI Assistant's answer. 'THUMBS_DOWN': when a user downvotes the AI Assistant's answer. type: string x-extensible-enum: - THUMBS_UP - THUMBS_DOWN - UNSPECIFIED copied: default: UNSPECIFIED description: | The feedback copy types are: 'ANSWER': when a user copies the AI Assistant's answer. 'CODE': when a user copies the code snippet from the AI Assistant's answer. type: string x-extensible-enum: - ANSWER - CODE - UNSPECIFIED comment: description: Additional text feedback optionally provided by a user. example: The suggested CLI command contained several typos. It was supposed to be "confluent" instead of "ccloud". maxLength: 500 nullable: true type: string type: object ai.v1.ChatCompletionsHistory: description: A question and answer pair from a previous interaction. properties: question: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsQuestion' description: Question for the AI assistant. answer: allOf: - $ref: '#/components/schemas/ai.v1.ChatCompletionsAnswer' description: Markdown-formatted answer from the AI assistant. type: object ai.v1.SessionId: description: Client-generated AI session ID. example: cd2ec6a3-82fe-4911-902a-065ff8425b66 format: uuid type: string ai.v1.DriftEnabled: default: false description: Indicates whether the backend can route to Confluent Chat Support with a human. type: boolean ai.v1.ChatCompletionsQuestion: description: Question for the AI assistant. example: What is my most expensive Kafka cluster? type: string ai.v1.ChatCompletionsAnswer: description: Markdown-formatted answer from the AI assistant. example: Your most expensive Kafka cluster is "lkc-12345". type: string ObjectMeta: description: ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. properties: self: description: Self is a Uniform Resource Locator (URL) at which an object can be addressed. This URL encodes the service location, API version, and other particulars necessary to locate the resource at a point in time example: https://api.confluent.cloud/v2/kafka-clusters/lkc-f3a90de format: uri readOnly: true type: string resource_name: description: Resource Name is a Uniform Resource Identifier (URI) that is globally unique across space and time. It is represented as a Confluent Resource Name example: crn://confluent.cloud/kafka=lkc-f3a90de format: uri readOnly: true type: string created_at: description: The date and time at which this object was created. It is represented in RFC3339 format and is in UTC. example: 2006-01-02T15:04:05-07:00 format: date-time readOnly: true type: string updated_at: description: The date and time at which this object was last updated. It is represented in RFC3339 format and is in UTC. example: 2006-01-02T15:04:05-07:00 format: date-time readOnly: true type: string deleted_at: description: The date and time at which this object was (or will be) deleted. It is represented in RFC3339 format and is in UTC. example: 2006-01-02T15:04:05-07:00 format: date-time readOnly: true type: string readOnly: true required: - self ListMeta: description: ListMeta describes metadata that resource collections may have properties: first: description: A link to the first page of results. If a response does not contain a first link, then direct navigation to the first page is not supported. example: https://api.confluent.cloud/v2/resourcekinds format: uri nullable: true type: string last: description: A link to the last page of results. If a response does not contain a last link, then direct navigation to the last page is not supported. example: https://api.confluent.cloud/v2/resourcekinds?page_token=bcAOehAY8F16YD84Z1wT format: uri nullable: true type: string prev: description: A link to the previous page of results. If a response does not contain a prev link, then either there is no previous data or backwards traversal through the result set is not supported. example: https://api.confluent.cloud/v2/resourcekinds?page_token=YIXRY97wWYmwzrax4dld format: uri nullable: true type: string next: description: A link to the next page of results. If a response does not contain a next link, then there is no more data available. example: https://api.confluent.cloud/v2/resourcekinds?page_token=UvmDWOB1iwfAIBPj6EYb format: uri nullable: true type: string total_size: description: Number of records in the full result set. This response may be paginated and have a smaller number of records. example: 123 format: int32 minimum: 0 type: integer type: object ObjectReference: description: ObjectReference provides information for you to locate the referred object properties: id: description: ID of the referred resource maxLength: 255 minLength: 1 type: string environment: description: Environment of the referred resource, if env-scoped maxLength: 255 minLength: 1 type: string related: description: API URL for accessing or modifying the referred object format: uri minLength: 1 readOnly: true type: string resource_name: description: CRN reference to the referred resource format: uri minLength: 1 readOnly: true type: string api_version: description: API group and version of the referred resource minLength: 1 readOnly: true type: string kind: description: Kind of the referred resource minLength: 1 readOnly: true type: string required: - id - related - resource_name type: object Failure: description: Provides information about problems encountered while performing an operation. properties: errors: description: List of errors which caused this operation to fail items: $ref: '#/components/schemas/Error' type: array uniqueItems: true required: - errors type: object Error: description: Describes a particular error encountered while performing an operation. properties: id: description: A unique identifier for this particular occurrence of the problem. maxLength: 255 type: string status: description: The HTTP status code applicable to this problem, expressed as a string value. type: string code: description: An application-specific error code, expressed as a string value. type: string title: description: A short, human-readable summary of the problem. It **SHOULD NOT** change from occurrence to occurrence of the problem, except for purposes of localization. type: string detail: description: A human-readable explanation specific to this occurrence of the problem. type: string source: $ref: '#/components/schemas/Error_source' type: object Error_source: description: If this error was caused by a particular part of the API request, the source will point to the query string parameter or request body property that caused it. properties: pointer: description: A JSON Pointer [RFC6901] to the associated entity in the request document [e.g. "/spec" for a spec object, or "/spec/title" for a specific field]. type: string parameter: description: A string indicating which query parameter caused the error. type: string type: object securitySchemes: cloud-api-key: description: Authenticate with Cloud API Keys using HTTP Basic Auth. Treat the Cloud API Key ID as the username and Cloud API Key Secret as the password. scheme: basic type: http