> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gostudio.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate only (no logging or billing)

> Runs the model and returns the output without writing a generation log or deducting credits. The result never appears in `/api/v2/me/generations`, and it cannot be finalized through `/record` — that endpoint only finalizes a generation log that already exists, and nothing creates one for this call. Use it only when you do your own logging and billing outside GoStudio; most integrations should use `POST /api/v2/apps/watermark-remover` instead, which logs the job and charges credits for you.

`webhook_url` also behaves differently here: it is registered directly with the upstream model provider as its own callback, so your server receives the provider's raw, provider-specific body rather than the GoStudio result payload. Synchronous models — including the default `lite` tier — ignore it and never call back at all.

Allowed callers: `user`. An internal service token passes the auth gate but carries no user context, so it cannot start a generation here.




## OpenAPI

````yaml /openapi.yaml post /api/v2/apps/watermark-remover/generate
openapi: 3.0.3
info:
  title: GoStudio Watermark Remover API
  version: 2.0.0
  description: >
    The Watermark Remover endpoints of the GoStudio v2 REST API. Every response
    uses a standard envelope: successes return `{ status, data }`; errors return
    `{ status, error: { type, code, dev, message } }`.


    Every endpoint here takes a **Supabase user JWT** as a Bearer token. An
    `internal` service token is accepted by the auth layer but carries no user
    identity, so it cannot be used to generate or look up a job. The one
    exception is the provider callback, which is authenticated by signature
    rather than by a caller token.
servers:
  - url: https://www.gostudio.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Watermark Remover
    description: AI watermark removal — orchestration, model metadata, and job polling.
  - name: Webhooks
    description: Endpoints called by external services, not by your application.
paths:
  /api/v2/apps/watermark-remover/generate:
    post:
      tags:
        - Watermark Remover
      summary: Generate only (no logging or billing)
      description: >
        Runs the model and returns the output without writing a generation log
        or deducting credits. The result never appears in
        `/api/v2/me/generations`, and it cannot be finalized through `/record` —
        that endpoint only finalizes a generation log that already exists, and
        nothing creates one for this call. Use it only when you do your own
        logging and billing outside GoStudio; most integrations should use `POST
        /api/v2/apps/watermark-remover` instead, which logs the job and charges
        credits for you.


        `webhook_url` also behaves differently here: it is registered directly
        with the upstream model provider as its own callback, so your server
        receives the provider's raw, provider-specific body rather than the
        GoStudio result payload. Synchronous models — including the default
        `lite` tier — ignore it and never call back at all.


        Allowed callers: `user`. An internal service token passes the auth gate
        but carries no user context, so it cannot start a generation here.
      operationId: generateWatermarkRemoval
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WatermarkGenerateRequest'
      responses:
        '200':
          description: Generation completed synchronously.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 200
                  data:
                    $ref: '#/components/schemas/WatermarkGenerateSyncResult'
        '202':
          description: Generation accepted and running asynchronously.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    example: 202
                  data:
                    $ref: '#/components/schemas/WatermarkGenerateAsyncResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
        '502':
          description: >
            The upstream model provider failed or was unreachable. Because this
            endpoint writes no generation log and deducts no credits, nothing is
            recorded and there is nothing to refund — just retry the call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 502
                error:
                  type: provider_error
                  code: provider_bad_gateway
                  dev: 50200
                  message: Generation is having trouble right now. Please try again.
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    WatermarkGenerateRequest:
      allOf:
        - $ref: '#/components/schemas/WatermarkRequest'
        - type: object
          properties:
            webhook_url:
              type: string
              format: uri
              description: >
                Behaves differently here than on `POST
                /api/v2/apps/watermark-remover`. This URL is registered directly
                with the upstream model provider as its own callback, so what
                your server receives is the provider's raw, provider-specific
                body (Replicate / Astria / Fal) with provider-hosted output URLs
                — not the GoStudio result payload, and not GoStudio CDN URLs. It
                is also ignored entirely by synchronous models, including the
                default `dewatermark/watermark-remover-pro` (`lite`), which
                return their output in the `200` response and never call back at
                all. Use `POST /api/v2/apps/watermark-remover` if you want the
                documented result payload delivered to your endpoint.
              example: https://your-app.com/webhooks/gostudio
    WatermarkGenerateSyncResult:
      type: object
      properties:
        kind:
          type: string
          enum:
            - sync
        model_id:
          type: string
        output_urls:
          type: array
          description: >
            Stored GoStudio CDN URLs — the sync tier's provider output is
            mirrored to GoStudio storage before it is returned, exactly as on
            the orchestrated endpoint.
          items:
            type: string
            format: uri
    WatermarkGenerateAsyncResult:
      type: object
      properties:
        kind:
          type: string
          enum:
            - async
        model_id:
          type: string
        provider_job_id:
          type: string
          description: >
            The upstream provider's own job identifier. It is not a GoStudio
            `job_id` and cannot be polled with `GET
            /api/v2/apps/watermark-remover/{jobId}`, which needs a
            generation-log ID — and this endpoint writes no log. The provider
            callback is the only way to collect an async result here.
        status:
          type: string
          enum:
            - processing
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 400
        error:
          type: object
          properties:
            type:
              type: string
              example: validation_error
            code:
              type: string
              example: invalid_input
            dev:
              type: integer
              example: 40001
            message:
              type: string
              example: Some information is invalid.
    WatermarkRequest:
      type: object
      required:
        - image_url
      properties:
        image_url:
          type: string
          format: uri
          description: >
            Publicly accessible `http`/`https` URL of the watermarked image. The
            API fetches it server-side, so it must not sit behind authentication
            or a firewall.
          example: https://example.com/watermarked.jpg
        model_id:
          type: string
          description: >
            Model to run. Accepts either a full model ID or one of the friendly
            tier aliases `lite`, `pro`, `advance`. Defaults to
            `dewatermark/watermark-remover-pro` (the `lite` tier). Cost per run:
            `lite` 4 credits, `pro` 4 credits, `advance` 10 credits. Call
            `/info` for the authoritative figures rather than hard-coding these
            — both the model list and the pricing can change.
          default: dewatermark/watermark-remover-pro
          example: pro
        prompt:
          type: string
          description: >
            Optional guidance. Ignored by models whose `requires_prompt` is
            `false` in the info response.
        webhook_url:
          type: string
          format: uri
          description: >
            HTTPS URL to receive the result when the generation finishes. Must
            be HTTPS; an `http://` URL is rejected with `400
            invalid_webhook_url`. Delivery is best-effort and fire-and-forget:
            the `POST` is sent once and never retried, the response status is
            ignored, and there is no signature header. If a delivery is missed,
            reconcile with `GET /api/v2/apps/watermark-remover/{jobId}`.
          example: https://your-app.com/webhooks/gostudio
  responses:
    BadRequest:
      description: The request was malformed or failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 400
            error:
              type: validation_error
              code: invalid_input
              dev: 40001
              message: Some information is invalid.
    Unauthorized:
      description: Missing or invalid Authorization Bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            error:
              type: authentication_error
              code: unauthorized
              dev: 40100
              message: Missing or invalid Authorization Bearer token.
    Forbidden:
      description: Caller type not allowed for this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 403
            error:
              type: permission_error
              code: forbidden
              dev: 40300
              message: You don't have permission for this action.
    UnprocessableContent:
      description: >
        The request was well-formed but the content could not be processed — for
        example the image was rejected by the model or flagged as NSFW.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 422
            error:
              type: provider_error
              code: content_filtered
              dev: 42205
              message: >-
                We couldn't generate this image. Please try a different prompt
                or image.
    RateLimited:
      description: Too many requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 429
            error:
              type: rate_limit_error
              code: rate_limited
              dev: 42900
              message: You're doing that too often. Please wait a moment.
    ServerError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 500
            error:
              type: system_error
              code: internal_error
              dev: 50000
              message: Something went wrong on our end.
    ServiceUnavailable:
      description: >
        A dependency is temporarily unavailable. Auth-dependent endpoints return
        `service_unavailable` (dev 50300) when the auth provider is down;
        generation endpoints return `model_unavailable` (dev 50301) when the
        model provider is. Both are safe to retry with backoff.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 503
            error:
              type: system_error
              code: service_unavailable
              dev: 50300
              message: Auth service is temporarily unavailable.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Supabase user JWT (or an internal service token). Send as
        `Authorization: Bearer <token>`.

````