1. Docs
  2. Reference
  3. REST API Docs
  4. AI

AI

    AI Template

    POST /api/ai/template

    Generates a Pulumi template using the Pulumi AI service.

    Request Body

    • language string required
      The programming language for the generated template (e.g. ’typescript’, ‘python’, ‘go’).
    • instructions string required
      Natural language instructions describing the desired infrastructure.
    • conversationId string optional
      Optional identifier to continue an existing AI conversation.
    • connectionId string optional
      Optional identifier for the connection/session.

    Responses

    200 OK

    List Org Conversations

    GET /api/orgs/{orgName}/ai/conversations

    Lists all Pulumi Copilot conversations across an entire organization.

    Request Parameters

    • orgName string path required
      The organization name
    • page integer query optional
      Page number for pagination
    • pageSize integer query optional
      Number of results per page

    Responses

    200 OK
    • conversations array[Conversation] required
      The list of conversations
    • id string required
      The unique identifier
    • created string required
      The creation timestamp
    • title string required
      The title
    • summary string required
      The summary

    List Conversations

    GET /api/orgs/{orgName}/ai/conversations/{userLogin}

    Lists all Pulumi Copilot conversations for a specific user within an organization.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • page integer query optional
      Page number for pagination
    • pageSize integer query optional
      Number of results per page

    Responses

    200 OK
    • conversations array[Conversation] required
      The list of conversations
    • id string required
      The unique identifier
    • created string required
      The creation timestamp
    • title string required
      The title
    • summary string required
      The summary

    Create Conversation

    POST /api/orgs/{orgName}/ai/conversations/{userLogin}

    Creates a new Pulumi Copilot conversation for the specified user.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name

    Request Body

    • conversation_id string required
      Unique identifier for the conversation, provided by the client.
    • origin string optional
      The origin

    Responses

    204 No Content
    Errors: 409 conversation id already registered

    Get Conversation

    GET /api/orgs/{orgName}/ai/conversations/{userLogin}/{conversationID}

    Retrieves the details and messages of a Pulumi Copilot conversation.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • conversationID string path required
      The unique identifier of the Pulumi Copilot conversation
    • page integer query optional
      Page number for pagination
    • pageSize integer query optional
      Number of results per page

    Responses

    200 OK
    • conversation Conversation required
      The conversation details
    • id string required
      The unique identifier
    • created string required
      The creation timestamp
    • title string required
      The title
    • summary string required
      The summary
    • messages array[Message] required
      The messages in the conversation
    • id string required
      The unique identifier of the message.
    • created string required
      The timestamp when the message was created, in ISO 8601 format.
    • model string required
      The AI model used to generate this message.
    • role string required
      The role of the message author (e.g. user, assistant).
    • message string required
      The text body of the message.
    • message_schema_version string required
      The schema version of the message format.
    • skills string required
      A JSON-encoded string of skill invocations associated with this message.
    • parent_conversation_message_id string required
      The ID of the parent conversation message, if this is a reply.
    Errors: 404 conversation

    Patch Conversation

    PATCH /api/orgs/{orgName}/ai/conversations/{userLogin}/{conversationID}

    Updates properties of an existing Pulumi Copilot conversation.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • conversationID string path required
      The unique identifier of the Pulumi Copilot conversation

    Request Body

    • title string required
      The updated title of the conversation.
    • summary string required
      The updated summary of the conversation.

    Responses

    204 No Content
    Errors: 404 conversation

    Submit Feedback

    POST /api/orgs/{orgName}/ai/conversations/{userLogin}/{conversationID}/feedback

    Submits user feedback on a Pulumi Copilot conversation.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • conversationID string path required
      The unique identifier of the Pulumi Copilot conversation

    Request Body

    • feedbackKind enum required
      The kind of feedback (thumbs up or thumbs down).
      Values: thumbsup, thumbsdown
    • comment string required
      A comment providing additional details about the feedback.

    Responses

    204 No Content
    Errors: 400 invalid feedbackKind. Only 'thumbsup' or 'thumbsdown' are allowed.

    Append Message To Conversation

    POST /api/orgs/{orgName}/ai/conversations/{userLogin}/{conversationID}/messages

    Appends a new message to an existing Pulumi Copilot conversation.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • conversationID string path required
      The unique identifier of the Pulumi Copilot conversation

    Request Body

    • model string required
      The AI model to use for generating the response (e.g. ‘gpt-4’, ‘claude-3’).
    • message string required
      The message text to append to the conversation.
    • message_schema_version string required
      Schema version of the message format, for forward/backward compatibility.
    • skills string required
      Comma-separated list of skill identifiers to enable for this message.
    • role string required
      The role of the message sender (e.g. ‘user’, ‘assistant’, ‘system’).

    Responses

    204 No Content
    Errors: 400 Invalid AI role. Only 'user' or 'assistant' are allowed. 404 conversation

    Fetch Program

    GET /api/orgs/{orgName}/ai/conversations/{userLogin}/{conversationID}/programs/{programID}.zip

    Fetches a template program as a zip file.

    Request Parameters

    • orgName string path required
      The organization name
    • userLogin string path required
      The user login name
    • conversationID string path required
      The unique identifier of the Pulumi Copilot conversation
    • programID string path required
      The identifier of the generated template program to download

    Responses

    200 OK
    Errors: 404 conversation or program

    Get Sent Message Count For User

    GET /api/user/ai/usage

    Returns the number of AI messages sent by the authenticated user. An optional lookback duration can be specified to limit the count to a recent time window.

    Request Parameters

    • lookbackDuration integer query optional
      Duration in seconds to look back for messages. Must be positive if provided.

    Responses

    200 OK
    • messages_sent integer required
      The number of messages sent
    Errors: 400 lookbackDuration must be positive