Red Hat Ansible Lightspeed with IBM watsonx Code Assistant API

REST API for Ansible Lightspeed, the generative AI service that produces and explains Ansible content. Provides playbook and role generation, content explanations, chat and streaming chat, content-match attribution against training data, feedback capture and watsonx Code Assistant model/key configuration.

Operations 23

POST /ai/chat/ Chat request #
POST /ai/completions/ Inline code suggestions #
POST /ai/contentmatches/ Code suggestion attributions #
POST /ai/explanations/ Playbook explanation #
POST /ai/explanations/role/ Role explanation #
POST /ai/feedback/ Feedback API for the AI service #
POST /ai/generations/playbook/ Playbook generation #
POST /ai/generations/role/ Role generation #
POST /ai/streaming_chat/ Streaming chat request #
GET /health/ Liveness probe #
GET /health/status/ Health check with backend server status #
GET /health/status/chatbot/ Chatbot health check #
GET /me/ #
GET /me/summary/ #
GET /telemetry/ Get the telemetry settings for an Organisation #
POST /telemetry/ Set the Telemetry settings for an Organisation #
GET /wca/apikey/ Get WCA key for an Organisation #
POST /wca/apikey/ Set the WCA key for an Organisation #
DELETE /wca/apikey/ DELETE WCA key for an Organization #
GET /wca/apikey/test/ Validate WCA key for an Organisation #
GET /wca/modelid/ Get WCA Model Id for an Organisation #
POST /wca/modelid/ Set the Model Id to be used for an Organisation #
GET /wca/modelid/test/ Validate WCA Model Id for an Organisation #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ansible-lightspeed-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

red-hat-ansible-automation-platform-ansible-lightspeed-openapi.json Raw ↑
{
    "openapi": "3.0.3",
    "info": {
        "title": "Ansible AI Connect.",
        "version": "1.0.0 (v1)",
        "description": "Equip the automation developer at Lightspeed."
    },
    "paths": {
        "/ai/chat/": {
            "post": {
                "operationId": "ai_chat_create",
                "description": "Send a message to the backend chatbot service and get a reply.",
                "summary": "Chat request",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ChatRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChatResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "400": {
                        "description": "Bad request"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "413": {
                        "description": "Prompt too long"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Internal server error"
                    },
                    "503": {
                        "description": "Service unavailable"
                    }
                },
                "x-ai-description": "Query the Ansible Automation Platform RAG database for documentation and product guidance on installing, configuring, and using AAP."
            }
        },
        "/ai/completions/": {
            "post": {
                "operationId": "ai_completions_create",
                "description": "Returns inline code suggestions based on a given Ansible editor context.",
                "summary": "Inline code suggestions",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/CompletionRequest"
                            },
                            "examples": {
                                "ValidExample": {
                                    "value": {
                                        "prompt": "---\n- hosts: all\n  become: yes\n\n  tasks:\n  - name: Install ssh\n"
                                    },
                                    "summary": "Request Sample",
                                    "description": "A valid sample request."
                                }
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/CompletionRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/CompletionRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/CompletionResponse"
                                },
                                "examples": {
                                    "ValidExample": {
                                        "value": {
                                            "predictions": [
                                                "    ansible.builtin.package:\n      name: openssh-server\n      state: present"
                                            ]
                                        },
                                        "summary": "Response sample",
                                        "description": "A valid sample response."
                                    }
                                }
                            }
                        },
                        "description": ""
                    },
                    "204": {
                        "description": "Empty response"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "503": {
                        "description": "Service Unavailable"
                    }
                },
                "x-ai-description": "Create new ai completion"
            }
        },
        "/ai/contentmatches/": {
            "post": {
                "operationId": "ai_contentmatches_create",
                "description": "Returns content matches that were the highest likelihood sources for a given code suggestion.",
                "summary": "Code suggestion attributions",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ContentMatchRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/ContentMatchRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ContentMatchRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ContentMatchResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "503": {
                        "description": "Service Unavailable"
                    }
                },
                "x-ai-description": "Create new ai contentmatch"
            }
        },
        "/ai/explanations/": {
            "post": {
                "operationId": "ai_explanations_create",
                "description": "Returns a text that explains a playbook.",
                "summary": "Playbook explanation",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ExplanationResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "204": {
                        "description": "Empty response"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "503": {
                        "description": "Service Unavailable"
                    }
                },
                "x-ai-description": "Create an explanation of a playbook"
            }
        },
        "/ai/explanations/role/": {
            "post": {
                "operationId": "ai_explanations_role_create",
                "description": "Returns a text that explains a role.",
                "summary": "Role explanation",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRoleRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRoleRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/ExplanationRoleRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ExplanationResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "204": {
                        "description": "Empty response"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "503": {
                        "description": "Service Unavailable"
                    }
                },
                "x-ai-description": "Create an explanation of a role"
            }
        },
        "/ai/feedback/": {
            "post": {
                "operationId": "ai_feedback_create",
                "description": "Feedback API for the AI service",
                "summary": "Feedback API for the AI service",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/FeedbackRequest"
                            },
                            "examples": {
                                "ValidInlineSuggestionFeedbackExample": {
                                    "value": {
                                        "inlineSuggestion": {
                                            "userActionTime": 5155,
                                            "action": "0",
                                            "suggestionId": "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6"
                                        }
                                    },
                                    "summary": "Feedback Request sample for inline suggestion to identify if the suggestion is accepted or ignored.",
                                    "description": "A valid inline suggestion feedback sample request to get details about the suggestion like user decision time, user action and suggestion id."
                                }
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/FeedbackRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/FeedbackRequest"
                            }
                        }
                    }
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Success"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "x-ai-description": "Create new ai feedback"
            }
        },
        "/ai/generations/playbook/": {
            "post": {
                "operationId": "ai_generations_playbook_create",
                "description": "Returns a playbook based on a text input.",
                "summary": "Playbook generation",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationPlaybookRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationPlaybookRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationPlaybookRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GenerationPlaybookResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "204": {
                        "description": "Empty response"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "503": {
                        "description": "Service Unavailable"
                    }
                },
                "x-ai-description": "Generate a playbook based on a text input"
            }
        },
        "/ai/generations/role/": {
            "post": {
                "operationId": "ai_generations_role_create",
                "description": "Returns a role based on a text input.",
                "summary": "Role generation",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationRoleRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationRoleRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/GenerationRoleRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GenerationRoleResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "401": {
                        "description": "Unauthorized"
                    }
                },
                "x-ai-description": "Generate a role based on a text input"
            }
        },
        "/ai/streaming_chat/": {
            "post": {
                "operationId": "ai_streaming_chat_create",
                "description": "Send a message to the backend chatbot service and get a streaming reply.",
                "summary": "Streaming chat request",
                "tags": [
                    "ai"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/StreamingChatRequest"
                            }
                        },
                        "application/x-www-form-urlencoded": {
                            "schema": {
                                "$ref": "#/components/schemas/StreamingChatRequest"
                            }
                        },
                        "multipart/form-data": {
                            "schema": {
                                "$ref": "#/components/schemas/StreamingChatRequest"
                            }
                        }
                    },
                    "required": true
                },
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ChatResponse"
                                }
                            }
                        },
                        "description": ""
                    },
                    "400": {
                        "description": "Bad request"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "413": {
                        "description": "Prompt too long"
                    },
                    "422": {
                        "description": "Validation failed"
                    },
                    "500": {
                        "description": "Internal server error"
                    },
                    "503": {
                        "description": "Service unavailable"
                    }
                },
                "x-ai-description": "Create new ai streaming chat"
            }
        },
        "/health/": {
            "get": {
                "operationId": "health_retrieve",
                "description": "Service Liveness Probe View",
                "summary": "Liveness probe",
                "tags": [
                    "health"
                ],
                "security": [
                    {
                        "cookieAuth": []
                    },
                    {}
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                },
                "x-ai-description": "Retrieve health status"
            }
        },
        "/health/status/": {
            "get": {
                "operationId": "health_status_retrieve",
                "description": "Service Health Check",
                "summary": "Health check with backend server status",
                "tags": [
                    "health"
                ],
                "security": [
                    {
                        "cookieAuth": []
                    },
                    {}
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "additionalProperties": true
                                },
                                "examples": {
                                    "ExampleOutput": {
                                        "value": {
                                            "status": "ok",
                                            "timestamp": "2023-03-13T17:25:17.240683",
                                            "version": "latest 0.1.202303131417",
                                            "git_commit": "b987bc43b90f8aca2deaf3bda85596f4b95a10a0",
                                            "deployed_region": "dev",
                                            "dependencies": [
                                                {
                                                    "name": "db",
                                                    "status": "ok",
                                                    "time_taken": 233.538
                                                },
                                                {
                                                    "name": "model-server",
                                                    "status": "ok",
                                                    "time_taken": 0.001
                                                }
                                            ]
                                        },
                                        "summary": "Example output"
                                    }
                                }
                            }
                        },
                        "description": ""
                    },
                    "500": {
                        "description": "One or more backend services are unavailable."
                    }
                },
                "x-ai-description": "Retrieve health status with backend servers status"
            }
        },
        "/health/status/chatbot/": {
            "get": {
                "operationId": "health_status_chatbot_retrieve",
                "description": "Chatbot health check",
                "summary": "Chatbot health check",
                "tags": [
                    "health"
                ],
                "security": [
                    {
                        "cookieAuth": []
                    },
                    {}
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                },
                "x-ai-description": "Retrieve chatbot health status"
            }
        },
        "/me/": {
            "get": {
                "operationId": "me_retrieve",
                "tags": [
                    "me"
                ],
                "security": [
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/UserResponse"
                                }
                            }
                        },
                        "description": ""
                    }
                },
                "x-ai-description": "Retrieve current user information"
            }
        },
        "/me/summary/": {
            "get": {
                "operationId": "me_summary_retrieve",
                "tags": [
                    "me"
                ],
                "security": [
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/MarkdownUserResponse"
                                }
                            }
                        },
                        "description": ""
                    }
                },
                "x-ai-description": "Retrieve current logged in user"
            }
        },
        "/telemetry/": {
            "get": {
                "operationId": "telemetry_settings_get",
                "summary": "Get the telemetry settings for an Organisation",
                "tags": [
                    "telemetry"
                ],
                "security": [
                    {
                        "oauth2": [
                            "read",
                            "write"
                        ]
                    },
                    {
                        "cookieAuth": []
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "429": {
                        "description": "Request was throttled"
                    },
                    "500": {
                        "description": "Internal service error"
                    },
                    "501": {
                        "description": "Not implemented"
                    }
                },
                "x-ai-description": "Get telemetry settings"
            },
            "post": {
                "operationId": "telemetry_settings_set",
                "summary": "Set the Telemetry settings for an Organisation",
                "tags": [
                    "telemetry"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/TelemetrySettingsRequest"
                            },
                            "examples": {
                                "ValidExample": {
                                    "value": {
                                        "optOut": true
                                    },
                                    "summary": "Request Telemetry settings",
                                    "description": "A valid request to set the Telemetry settings."
                                }
                            }
                        },
                        "application/x-www-form-urlencoded": {
         

# --- truncated at 32 KB (88 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/red-hat-ansible-automation-platform/refs/heads/main/openapi/red-hat-ansible-automation-platform-ansible-lightspeed-openapi.json