SMILI Developers
    CLI Docs

    Model Context Protocol (MCP)

    Connect AI Portal to compatible AI agents and generate images and videos using your AI Portal models directly from chat or coding workflows.

    Endpoint

    The AI Portal MCP server uses the Streamable HTTP transport.

    Not configured

    Authentication

    Two authentication methods are supported. Choose the one that fits your client.

    OAuth 2.1 + PKCE

    For ChatGPT and other OAuth-capable agents. Authorize once — no token copy-paste.

    Personal Access Token

    For the MCP SDK, CLI, and any client that supports manual Bearer tokens.

    Personal Access Token (PAT)

    1. Go to Settings → AI Portal MCP.
    2. Click Create new token, choose scopes, expiry, and total/daily credit caps.
    3. Copy the token — it is shown only once.
    4. Pass it as Authorization: Bearer <token>.
    5. Credit caps are nonnegative whole numbers. A cap of 0 blocks credit use; it does not mean unlimited. Daily usage resets at 00:00 UTC.

    Connect ChatGPT via OAuth 2.1

    ChatGPT uses OAuth 2.1 + PKCE. You do not need to create a token manually — ChatGPT handles the authorization flow automatically using the discovery endpoints below.

    Check the client identity on the consent screen.

    A dynamically registered (DCR) client may claim any display name. An “unverified” label means AI Portal has not verified that name or branding, so only approve it when you trust the app that initiated the request. You can also set total and UTC-daily credit caps before approval; a cap of 0 blocks credit use.

    OAuth discovery endpoints (auto-discovered by ChatGPT)

    Protected Resource Metadata/.well-known/oauth-protected-resource/api/mcp
    Authorization Server Metadata/.well-known/oauth-authorization-server/api
    Client Registration/api/oauth/register
    Authorization Endpoint/api/oauth/authorize
    Token Endpoint/api/oauth/token
    Revocation Endpoint/api/oauth/revoke

    How to connect ChatGPT (requires an account with Developer mode access)

    1. Enable Developer mode in ChatGPT settings. Workspace accounts may require an administrator to enable it.
    2. Open the apps/plugins area and create a custom MCP app.
    3. Paste the MCP endpoint URL: https://veogoogle.ai/api/mcp
    4. Select OAuth as the authentication method. ChatGPT will auto-discover the OAuth endpoints.
    5. Click Scan Tools. ChatGPT will redirect you to AI Portal to sign in and approve access.
    6. Click Create. The connector appears in your workspace.
    7. Use it in a chat by selecting the app from the tools menu and prompting: "Generate an image of a sunset over the ocean."

    Compatibility: Account eligibility and menu names vary by client. Claude supports custom remote connectors; Gemini custom-app availability depends on your region and account. Use the canonical MCP URL as the OAuth resource at authorization and token exchange. Access tokens expire after one hour; refresh tokens rotate and retain the same approved credit budget. Legacy discovery aliases remain supported. A successful connection must still be verified in your chosen client.

    Connecting Clients

    The official @modelcontextprotocol/sdk client has been tested with this Streamable HTTP endpoint and bearer authentication. Compatibility with Claude Code, Cursor, and Codex has not been verified and is not asserted.

    Official JavaScript SDK

    Keep the endpoint and Personal Access Token in environment variables.

    Connection setup is disabled until the MCP endpoint is configured.

    Supported Models

    These are the models currently mapped and supported by your AI Portal MCP connection.

    Sign in to view models available on your account.

    Sign In

    Available Tools

    generate_image

    Generate an image using a specified model.

    • prompt (string, required): Description of the image.
    • model (string, required): Model ID (use list_available_models).
    • idempotency_key (string, optional): 8–128 character unique key. If omitted, the server creates and returns one. Reuse that key and the same inputs when retrying; omitting it again starts a new request.
    • aspect_ratio (string): One of the selected model's advertised ratios.
    • reference_images (array): Owned gallery image IDs, image:<asset-id>, or exact HTTPS URLs of owned gallery images. Arbitrary URLs and uploads/local files are rejected.

    generate_video

    Generate a video using a specified model.

    • prompt (string, required): Description of the video.
    • model (string, required): Model ID.
    • idempotency_key (string, optional): Reuse the supplied or server-returned key and the same inputs when retrying.
    • duration, aspect_ratio, native_audio (optional): Use only values advertised by the model.
    • reference_images, start_frame, end_frame (optional): Owned gallery references only; arbitrary URLs and uploads/local files are rejected.

    get_generation

    Retrieve the status and result of an async generation job.

    • generation_id (string, required): ID returned by generate tools.

    list_available_models

    List all image and video models you have access to.

    Error Codes

    CodeDescription
    INVALID_MODELThe model ID is incorrect or unavailable.
    UNAUTHORIZEDInvalid or missing token.
    INSUFFICIENT_CREDITSYou don't have enough credits.
    RATE_LIMITEDToo many requests. Please slow down.