{"openapi":"3.0.3","info":{"description":"Pryon Generative API.","title":"Generative API","version":"1.0"},"servers":[{"url":"{pryon_base_url}"}],"tags":[{"name":"Generative"}],"paths":{"/api/generative/v1alpha1/chat/completions":{"post":{"summary":"Chat Completions","description":"Generates a model response from a list of messages comprising a conversation.","operationId":"Generative_CreateChatCompletions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionsResponse"}}},"description":"OK"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}},"description":"Default error response"}},"tags":["Generative"],"parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Authorization: Bearer {base64-encoded-token}"},{"name":"x-pryon-org-id","in":"header","required":false,"schema":{"type":"string"},"description":"Organization ID; only required for organizations with multiple tenants.","example":"pryoninc.com"}]}},"/api/generative/v1alpha1/chat/completions/models":{"get":{"description":"Lists the models available for our Chat Completions API.","operationId":"Generative_ListChatCompletionsModels","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatCompletionsModelsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChatCompletionsModelsResponse"}}},"description":"OK"},"default":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Status"}}},"description":"Default error response"}},"tags":["Generative"],"summary":"List Models","parameters":[{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"},"example":"Authorization: Bearer {base64-encoded-token}"},{"name":"x-pryon-org-id","in":"header","required":false,"schema":{"type":"string"},"description":"Organization ID; only required for organizations with multiple tenants.","example":"pryoninc.com"}]}},"/api/generative/v1alpha1/tasks/complete-query":{},"/api/generative/v1alpha1/tasks/route-query":{}},"components":{"schemas":{"ChatCompletionsModel":{"description":"An individual Chat Completions model","properties":{"id":{"description":"ID of the model to use, in provider/model_id format; for a list of valid entries, see the [available models](https://docs.pryon.com/reference/available-models-for-chat-completions#/).","type":"string"},"display_name":{"description":"The name of the model.","type":"string"}},"required":["messages","model"],"type":"object"},"ChatCompletionsModels":{"description":"A list of our Chat Completions models.","properties":{"models":{"description":"List of all the available models for our Chat Completions API.","items":{"$ref":"#/components/schemas/ChatCompletionsModel"},"type":"array"}},"type":"object"},"ChatCompletionsRequest":{"properties":{"messages":{"description":"List of messages that form the conversation.","type":"array","items":{"$ref":"#/components/schemas/Message"}},"model":{"description":"ID of the model to use, in provider/model_id format; for a list of valid entries, see the [available models](https://docs.pryon.com/reference/available-models-for-chat-completions#/).","type":"string"},"temperature":{"type":"number","format":"float","description":"Sampling temperature; the range depends on the product and model being called; higher values, for example, 0.8, make the output more random, while lower values, for example, 0.2, make the output more focused and deterministic; it is recommended that you adjust this value or top_p, but not both."},"top_p":{"type":"number","format":"float","description":"Alternative to sampling with temperature, that is, nucleus sampling; the model considers the results of the tokens with top_p probability mass, for example, 0.1 means tokens comprising the top 10% probability mass are considered."},"stream":{"type":"boolean","description":"If set to True, the model response data is generated using server-sent events and streamed to the client."},"stop":{"type":"array","items":{"type":"string"},"description":"Stop sequence signals for the API generation."},"max_completion_tokens":{"type":"integer","format":"int32","description":"Maximum number of tokens generated in the chat completion; can be used to control costs for text generated via API."},"logprobs":{"type":"boolean","description":"True returns the log probabilities of each output token present in the content of message; False does not return probabilities."},"top_logprobs":{"type":"integer","format":"int32","description":"Number from 0 to 20 which specifies the number of most likely tokens and associated log probabilities to return at each token position; must be set to True to return this information."}},"type":"object"},"ChatCompletionsResponse":{"description":"Response for chat completion\n non-streaming: https://platform.openai.com/docs/api-reference/chat/object\n streaming: https://platform.openai.com/docs/api-reference/chat/streaming","properties":{"id":{"description":"Unique identifier for the chat completion.","type":"string"},"choices":{"description":"List chat completion choices.","items":{"$ref":"#/components/schemas/Choice"},"type":"array"},"created":{"description":"Creation timestamp (in seconds) for the chat completion.","type":"string"},"model":{"description":"Model used for chat completion.","type":"string"},"object":{"description":"Object type; choices are chat.completion or chat.completion.chunk.","type":"string"},"usage":{"allOf":[{"$ref":"#/components/schemas/Usage"}],"description":"Usage statistics for the completion"}},"type":"object"},"Choice":{"description":"Individual completion choice","properties":{"index":{"description":"Index of the choice","format":"int32","type":"integer"},"message":{"allOf":[{"$ref":"#/components/schemas/Message"}],"description":"The message containing the completion.\n Present only if stream=false in request."},"delta":{"allOf":[{"$ref":"#/components/schemas/Delta"}],"description":""},"logprobs":{"description":"Log probability information for the choice.","items":{"$ref":"#/components/schemas/LogProbs"},"type":"array"},"finish_reason":{"description":"Detailed explanation of the completion process.","type":"string"}},"type":"object"},"CompleteQueryRequest":{"properties":{"query":{"description":"Query provided to add additional context.","type":"string"},"conversation_context":{"description":"Context for prior turns in the conversation.","type":"string"},"conversation_id":{"description":"Retrieve context history (question-answer pairs) from previous exchanges in the conversation.","type":"string"}},"type":"object"},"CompleteQueryResponse":{"properties":{"completed_query":{"type":"string","description":"Full text of the rewritten query."}},"type":"object"},"Delta":{"properties":{"role":{"type":"string","description":"Role of the message sender, that is, system, user, or assistant."},"content":{"type":"string","description":"Content that has changes in the message."}},"title":"Change in a streaming message"},"GoogleProtobufAny":{"additionalProperties":true,"description":"Contains an arbitrary serialized message along with a @type that describes the type of the serialized message.","properties":{"@type":{"description":"The type of the serialized message.","type":"string"}},"type":"object"},"ListChatCompletionsModelsRequest":{"description":"The request schema for our ListChatCompletionsModels endpoint","properties":{},"type":"object"},"ListChatCompletionsModelsResponse":{"description":"Response for ListChatCompletionsModels\n Provides all the available models for our Chat Completions API","properties":{"items":{"additionalProperties":{"$ref":"#/components/schemas/ChatCompletionsModels"},"description":"Available models for the Chat Completions API; listed by provider.","type":"object"}},"type":"object"},"LogProbToken":{"properties":{"token":{"description":"The token returned.","type":"string"},"logprob":{"description":"Log probability for the token; displays position if within the top 20 most likely tokens or -9999.0 to signify an unlikely token.","format":"float","type":"number"},"bytes":{"description":"The UTF-8 bytes representation of the token; null if there is no byte representation; deliniates between multiple tokens when byte representations are combined to generate text representation.","items":{"format":"int32","type":"integer"},"type":"array"}},"type":"object"},"LogProbTokenWithTop":{"properties":{"token":{"description":"The token returned.","type":"string"},"logprob":{"description":"Log probability for the token; displays position if within the top 20 most likely tokens or -9999.0 to signify an unlikely token.","format":"float","type":"number"},"bytes":{"description":"The UTF-8 bytes representation of the token; null if there is no byte representation; deliniates between multiple tokens when byte representations are combined to generate text representation.","items":{"format":"int32","type":"integer"},"type":"array"},"top_logprobs":{"description":"List of the most likely tokens and their log probability for the token position; may be fewer than the number of requested top_logprobs returned.","items":{"$ref":"#/components/schemas/LogProbToken"},"type":"array"}},"type":"object"},"LogProbs":{"properties":{"content":{"description":"A list of message content tokens with log probability information.","items":{"$ref":"#/components/schemas/LogProbTokenWithTop"},"type":"array"},"refusal":{"description":"List of message refusal tokens with log probability information.","items":{"$ref":"#/components/schemas/LogProbTokenWithTop"},"type":"array"}},"type":"object"},"Message":{"description":"Individual message in the conversation.","properties":{"role":{"type":"string","description":"Role of the message sender, that is, system, user, or assistant."},"content":{"type":"string","description":"Content of the message."}},"title":"Individual message in the conversation"},"RouteQueryRequest":{"properties":{"query":{"description":"Query provided to generate a response.","type":"string"},"domain":{"description":"Brief definition of the subject domain of your collection; default is the company you support.","type":"string"},"enable_generative_conversational_response":{"description":"Whether conversational responses are generated or canned.","type":"boolean"}},"type":"object"},"RouteQueryResponse":{"properties":{"is_intelligible":{"description":"Whether the given query is intelligible.","type":"boolean"},"is_english":{"description":"Whether the given query is in a supported language.","type":"boolean"},"is_conversational":{"description":"Whether the given query is conversational.","type":"boolean"},"conversational_response":{"description":"The LLM-generated response to a conversational query.","type":"string"}},"type":"object"},"Status":{"description":"The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).","properties":{"code":{"description":"The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].","format":"int32","type":"integer"},"message":{"description":"A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.","type":"string"},"details":{"description":"A list of messages that carry the error details. There is a common set of message types for APIs to use.","items":{"$ref":"#/components/schemas/GoogleProtobufAny"},"type":"array"}},"type":"object"},"Usage":{"description":"","properties":{"prompt_tokens":{"description":"Tokens in the prompt.","format":"int32","type":"integer"},"completion_tokens":{"description":"Tokens in the completion.","format":"int32","type":"integer"},"total_tokens":{"description":"Total tokens used.","format":"int32","type":"integer"}},"type":"object"}}}}