# ai

AI-powered trip generation from documents and text.
**Base URL:** `https://ai.api.moguplatform.com`
AI endpoints use a separate server from Trips & Catalogs endpoints.
**Public vs authenticated responses:** The `GET /trip-imports/{publicId}/status` endpoint is public and does not require authentication. Public responses omit the `error` message and `aiCredits` fields. Authenticated endpoints return the full response including error details and credits consumed.

 - [POST /trip-imports](https://api-docs.moguplatform.com/openapi/ai/createtripfromdocument.md): Create a new trip from a document using AI. Supports URLs to documents (PDF, TXT, images) or plain text descriptions. The job runs asynchronously. Use the returned status URL to poll for completion. *
 - [GET /trip-imports/{publicId}/status](https://api-docs.moguplatform.com/openapi/ai/getjobstatus.md): Get the current status of a trip creation job. This endpoint is public and does not require authentication. **Status values:** - `processing`: Job is still running - `completed`: Trip has been created
 - [POST /trip-imports/{publicId}/actions/cancel](https://api-docs.moguplatform.com/openapi/ai/canceljob.md): Cancel a job that is still in progress. Only the agent who created the job can cancel it. Jobs can only be canceled while in `processing` status. Completed, errored, or already canceled jobs cannot be
