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

> ## Agent Instructions
> The base URL is https://api.sudomock.com.
> Authenticate every request with the x-api-key header. Keys begin with sm_.
> A render returns the finished image at data.print_files[0].export_path. A request sent with is_async true returns a job_id to poll at GET /api/v1/jobs/{job_id}.
> Prefer the official SDKs over hand-written HTTP calls: npm install sudomock for Node, pip install sudomock for Python.

# Retrieve the current account

> Returns account details, subscription info, usage statistics, and API key metadata for the authenticated user. Requires x-api-key header authentication.

<RequestExample>
  ```js Node.js theme={"theme":{"light":"github-light","dark":"vesper"}}
  const response = await fetch("https://api.sudomock.com/api/v1/me", {
    method: "GET",
    headers: { "x-api-key": "sm_your_api_key" },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```php PHP theme={"theme":{"light":"github-light","dark":"vesper"}}
  <?php

  $ch = curl_init("https://api.sudomock.com/api/v1/me");
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "x-api-key: sm_your_api_key",
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vesper"}}
  import requests

  response = requests.get(
      "https://api.sudomock.com/api/v1/me",
      headers={"x-api-key": "sm_your_api_key"},
  )

  response.raise_for_status()
  print(response.json())
  ```

  ```ruby Ruby theme={"theme":{"light":"github-light","dark":"vesper"}}
  require "net/http"
  require "uri"

  uri = URI("https://api.sudomock.com/api/v1/me")
  request = Net::HTTP::Get.new(uri)
  request["x-api-key"] = "sm_your_api_key"

  response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
    http.request(request)
  end

  puts response.body
  ```

  ```go Go theme={"theme":{"light":"github-light","dark":"vesper"}}
  package main

  import (
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	req, err := http.NewRequest("GET", "https://api.sudomock.com/api/v1/me", nil)
  	if err != nil {
  		panic(err)
  	}
  	req.Header.Set("x-api-key", "sm_your_api_key")

  	res, err := http.DefaultClient.Do(req)
  	if err != nil {
  		panic(err)
  	}
  	defer res.Body.Close()

  	body, _ := io.ReadAll(res.Body)
  	fmt.Println(string(body))
  }
  ```

  ```java Java theme={"theme":{"light":"github-light","dark":"vesper"}}
  import java.net.URI;
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.sudomock.com/api/v1/me"))
      .header("x-api-key", "sm_your_api_key")
      .GET()
      .build();

  HttpResponse<String> response = HttpClient.newHttpClient()
      .send(request, HttpResponse.BodyHandlers.ofString());

  System.out.println(response.body());
  ```

  ```csharp .NET theme={"theme":{"light":"github-light","dark":"vesper"}}
  using System.Net.Http;
  using System.Text;

  var request = new HttpRequestMessage(HttpMethod.Get, "https://api.sudomock.com/api/v1/me");
  request.Headers.Add("x-api-key", "sm_your_api_key");

  var client = new HttpClient();
  var response = await client.SendAsync(request);

  Console.WriteLine(await response.Content.ReadAsStringAsync());
  ```

  ```bash cURL theme={"theme":{"light":"github-light","dark":"vesper"}}
  curl -X GET "https://api.sudomock.com/api/v1/me" \
    -H "x-api-key: sm_your_api_key"
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={"theme":{"light":"github-light","dark":"vesper"}}
  {
    "data": {
      "account": {
        "created_at": "2025-06-15T10:30:00Z",
        "email": "user@example.com",
        "name": "Acme Corp",
        "uuid": "123e4567-e89b-12d3-a456-426614174000"
      },
      "api_key": {
        "created_at": "2025-06-15T10:30:00Z",
        "last_used_at": "2026-01-05T00:25:00Z",
        "name": "Production Key",
        "total_requests": 847293
      },
      "organization": {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "name": "Acme"
      },
      "subscription": {
        "current_period_end": "2026-02-05T00:00:00Z",
        "plan": "pro",
        "status": "active",
        "tier": "pro"
      },
      "usage": {
        "billing_period_end": "2026-02-01T00:00:00Z",
        "billing_period_start": "2026-01-01T00:00:00Z",
        "credits_limit": 50000,
        "credits_remaining": 37153,
        "credits_used_this_month": 12847,
        "prepaid_balance": 0.0,
        "prepaid_balance_currency": "usd"
      }
    },
    "success": true
  }
  ```
</ResponseExample>


## OpenAPI

````yaml openapi.json GET /api/v1/me
openapi: 3.1.0
info:
  title: SudoMock API
  description: >-
    Product mockup API. Render PSD templates, turn product photos into reusable
    mockups, create still images and videos, personalize text with fonts, and
    manage asynchronous jobs and signed webhooks.


    Every endpoint answers failures with the same envelope, so the status codes,
    the error_code values and the retry rule are documented once at
    https://sudomock.com/docs/errors rather than repeated per operation.
  version: 1.0.0
servers:
  - url: https://api.sudomock.com
    description: Production
security: []
tags:
  - name: PSD mockups
    description: Turn a Photoshop file into a reusable mockup, then render it.
  - name: Photo mockups
    description: Turn a product photo into a reusable mockup, then render artwork onto it.
  - name: Video mockups
    description: Render a mockup as a short video.
  - name: Fonts
    description: Upload and manage the fonts available to text layers.
  - name: Background removal
    description: Isolate a subject from its background as a standalone step.
  - name: Studio
    description: Open an embedded editor session and read what the customer produced in it.
  - name: Webhook endpoints
    description: Register signed endpoints and manage their secrets.
  - name: Webhook deliveries
    description: Inspect, replay and retry what those endpoints received.
  - name: Jobs
    description: Poll queued renders and read their results.
  - name: Account
    description: Read the current account, its plan and its remaining credits.
paths:
  /api/v1/me:
    get:
      tags:
        - Account
      summary: Retrieve the current account
      description: >-
        Returns account details, subscription info, usage statistics, and API
        key metadata for the authenticated user. Requires x-api-key header
        authentication.
      operationId: get_current_user_info_api_v1_me_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MeResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: Node.js
          source: |-
            const response = await fetch("https://api.sudomock.com/api/v1/me", {
              method: "GET",
              headers: { "x-api-key": "sm_your_api_key" },
            });

            const data = await response.json();
            console.log(data);
        - lang: PHP
          source: |-
            <?php

            $ch = curl_init("https://api.sudomock.com/api/v1/me");
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                "x-api-key: sm_your_api_key",
            ]);

            $response = curl_exec($ch);
            curl_close($ch);

            echo $response;
        - lang: Python
          source: |-
            import requests

            response = requests.get(
                "https://api.sudomock.com/api/v1/me",
                headers={"x-api-key": "sm_your_api_key"},
            )

            response.raise_for_status()
            print(response.json())
        - lang: Ruby
          source: >-
            require "net/http"

            require "uri"


            uri = URI("https://api.sudomock.com/api/v1/me")

            request = Net::HTTP::Get.new(uri)

            request["x-api-key"] = "sm_your_api_key"


            response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do
            |http|
              http.request(request)
            end


            puts response.body
        - lang: Go
          source: "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n)\n\nfunc main() {\n\treq, err := http.NewRequest(\"GET\", \"https://api.sudomock.com/api/v1/me\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treq.Header.Set(\"x-api-key\", \"sm_your_api_key\")\n\n\tres, err := http.DefaultClient.Do(req)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, _ := io.ReadAll(res.Body)\n\tfmt.Println(string(body))\n}"
        - lang: Java
          source: |-
            import java.net.URI;
            import java.net.http.HttpClient;
            import java.net.http.HttpRequest;
            import java.net.http.HttpResponse;

            HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://api.sudomock.com/api/v1/me"))
                .header("x-api-key", "sm_your_api_key")
                .GET()
                .build();

            HttpResponse<String> response = HttpClient.newHttpClient()
                .send(request, HttpResponse.BodyHandlers.ofString());

            System.out.println(response.body());
        - lang: .NET
          source: >-
            using System.Net.Http;

            using System.Text;


            var request = new HttpRequestMessage(HttpMethod.Get,
            "https://api.sudomock.com/api/v1/me");

            request.Headers.Add("x-api-key", "sm_your_api_key");


            var client = new HttpClient();

            var response = await client.SendAsync(request);


            Console.WriteLine(await response.Content.ReadAsStringAsync());
        - lang: cURL
          source: |-
            curl -X GET "https://api.sudomock.com/api/v1/me" \
              -H "x-api-key: sm_your_api_key"
components:
  schemas:
    MeResponse:
      properties:
        data:
          $ref: '#/components/schemas/MeResponseData'
          description: Response data
        success:
          type: boolean
          description: Success status
          default: true
          examples:
            - true
      type: object
      required:
        - data
      title: MeResponse
      description: Your account, plan, usage and remaining credits.
      example:
        data:
          account:
            created_at: '2025-06-15T10:30:00Z'
            email: user@example.com
            name: Acme Corp
            uuid: 123e4567-e89b-12d3-a456-426614174000
          api_key:
            created_at: '2025-06-15T10:30:00Z'
            last_used_at: '2026-01-05T00:25:00Z'
            name: Production Key
            total_requests: 847293
          organization:
            id: 123e4567-e89b-12d3-a456-426614174000
            name: Acme
          subscription:
            current_period_end: '2026-02-05T00:00:00Z'
            plan: pro
            status: active
            tier: pro
          usage:
            billing_period_end: '2026-02-01T00:00:00Z'
            billing_period_start: '2026-01-01T00:00:00Z'
            credits_limit: 50000
            credits_remaining: 37153
            credits_used_this_month: 12847
            prepaid_balance: 0
            prepaid_balance_currency: USD
        success: true
    MeResponseData:
      properties:
        account:
          $ref: '#/components/schemas/MeAccountData'
          description: User account information
        organization:
          $ref: '#/components/schemas/MeOrganizationData'
          description: Organization that owns the subscription and usage below
        subscription:
          $ref: '#/components/schemas/MeSubscriptionData'
          description: Subscription details
        usage:
          $ref: '#/components/schemas/MeUsageData'
          description: Usage statistics
        api_key:
          anyOf:
            - $ref: '#/components/schemas/MeApiKeyData'
            - type: 'null'
          description: Current API key metadata
      type: object
      required:
        - account
        - organization
        - subscription
        - usage
      title: MeResponseData
      description: Data payload in /me response
    MeAccountData:
      properties:
        uuid:
          type: string
          description: User UUID
          examples:
            - c33f5fdf-346e-4c37-8686-9afcca4645ef
        email:
          type: string
          description: User email address
          examples:
            - user@example.com
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: Account/company name from user_metadata
          examples:
            - Acme Corp
        created_at:
          type: string
          format: date-time
          description: Account creation timestamp
          examples:
            - '2025-06-15T10:30:00Z'
      type: object
      required:
        - uuid
        - email
        - created_at
      title: MeAccountData
      description: Account information in /me response
      example:
        created_at: '2025-06-15T10:30:00Z'
        email: user@example.com
        name: Acme Corp
        uuid: 123e4567-e89b-12d3-a456-426614174000
    MeOrganizationData:
      properties:
        id:
          type: string
          description: Organization UUID
          examples:
            - 97d7a314-29be-47b5-997c-df7f0ca71eb8
        name:
          type: string
          description: Organization name
          examples:
            - Acme
      type: object
      required:
        - id
        - name
      title: MeOrganizationData
      description: Organization the request acts on in /me response
      example:
        id: 123e4567-e89b-12d3-a456-426614174000
        name: Acme
    MeSubscriptionData:
      properties:
        plan:
          type: string
          description: Plan slug (e.g., 'pro-25k', 'scale-100k', 'free')
          examples:
            - pro-25k
        tier:
          type: string
          description: Plan tier for feature gating (e.g., 'free', 'pro', 'scale')
          examples:
            - pro
        status:
          type: string
          description: >-
            Subscription status: 'active', 'cancelled', 'past_due', 'expired',
            'paused'
          examples:
            - active
        current_period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: End of current billing period
          examples:
            - '2026-02-05T00:00:00Z'
        billing_channel:
          type: string
          enum:
            - shopify
            - stripe
            - none
          description: >-
            Which billing channel currently owns this subscription. Frontend
            uses this for lock-to-channel UI gating.
          default: none
          examples:
            - stripe
      type: object
      required:
        - plan
        - tier
        - status
      title: MeSubscriptionData
      description: Subscription information in /me response
      example:
        billing_channel: stripe
        current_period_end: '2026-02-05T00:00:00Z'
        plan: pro-25k
        status: active
        tier: pro
    MeUsageData:
      properties:
        credits_used_this_month:
          type: integer
          description: Credits used in current billing period
          examples:
            - 12847
        credits_limit:
          type: integer
          description: Total credits available per month from plan
          examples:
            - 50000
        credits_remaining:
          type: integer
          description: Credits remaining (calculated)
          examples:
            - 37153
        billing_period_start:
          type: string
          format: date-time
          description: Start of current billing period
          examples:
            - '2026-01-01T00:00:00Z'
        billing_period_end:
          type: string
          format: date-time
          description: End of current billing period
          examples:
            - '2026-02-01T00:00:00Z'
        prepaid_balance:
          type: number
          description: >-
            Prepaid balance remaining, in prepaid_balance_currency. 0 when the
            account holds no balance (never null). Independent of the credits_*
            fields above, which count a subscription allotment.
          examples:
            - 4.3
        prepaid_balance_currency:
          type: string
          description: ISO 4217 currency of prepaid_balance. Always USD today.
          examples:
            - USD
      type: object
      required:
        - credits_used_this_month
        - credits_limit
        - credits_remaining
        - billing_period_start
        - billing_period_end
        - prepaid_balance
        - prepaid_balance_currency
      title: MeUsageData
      description: Usage statistics in /me response
      example:
        billing_period_end: '2026-02-01T00:00:00Z'
        billing_period_start: '2026-01-01T00:00:00Z'
        credits_limit: 50000
        credits_remaining: 37153
        credits_used_this_month: 12847
        prepaid_balance: 4.3
        prepaid_balance_currency: USD
    MeApiKeyData:
      properties:
        name:
          type: string
          description: API key name
          examples:
            - Production Key
        created_at:
          type: string
          format: date-time
          description: When the API key was created
          examples:
            - '2025-06-15T10:30:00Z'
        last_used_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          description: Last time the API key was used
          examples:
            - '2026-01-05T00:25:00Z'
        total_requests:
          type: integer
          description: Total credit-consuming operations recorded for this API key
          examples:
            - 847293
      type: object
      required:
        - name
        - created_at
        - total_requests
      title: MeApiKeyData
      description: API key metadata in /me response
      example:
        created_at: '2025-06-15T10:30:00Z'
        last_used_at: '2026-01-05T00:25:00Z'
        name: Production Key
        total_requests: 847293
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        API key with sm_ prefix. Get your key at
        https://sudomock.com/dashboard/api-keys

````