### GET /v1/usage/summary Source: https://midsync.dev/en/developers/docs/usage-summary-api Fetch aggregated usage totals for summary cards and dashboard views. This endpoint is best for teams building billing dashboards and high-level account summaries. ```APIDOC ## GET /v1/usage/summary ### Description Fetch aggregated usage totals for summary cards and dashboard views. Use this endpoint for overview cards. It complements usage logs by giving totals instead of per-request rows. ### Method GET ### Endpoint /v1/usage/summary ### Parameters #### Query Parameters - **date range** (string) - Optional - Optional date window for summary aggregation if supported. - **groupBy** (string) - Optional - Optional grouping such as by model when supported. ### Request Example ```bash curl --request GET \ --url "https://api.midsync.dev/v1/usage/summary" \ --header "Authorization: Bearer " ``` ### Response #### Success Response (200) - **totalPointsCharged** (number) - Total charged points for the selected period. - **totalRequests** (integer) - Total requests in the selected period. - **totalInputTokens** (integer) - Aggregated input token totals when relevant. - **totalOutputTokens** (integer) - Aggregated output token totals when relevant. - **byModel** (array) - Per-model summary breakdown. - **model** (string) - The name of the model. - **requests** (integer) - The number of requests for this model. - **pointsCharged** (number) - The points charged for this model. #### Response Example ```json { "totalPointsCharged": 1234.56, "totalRequests": 321, "totalInputTokens": 120000, "totalOutputTokens": 45000, "byModel": [ { "model": "gpt-5-4", "requests": 120, "pointsCharged": 530.12 } ] } ``` ``` -------------------------------- ### GET /v1/usage/logs Source: https://midsync.dev/en/developers/docs/usage-logs-api Fetches detailed usage history for request-level tables and billing visibility. This endpoint is best suited for teams building detailed billing tables and usage history pages, providing per-request model tracking. ```APIDOC ## GET /v1/usage/logs ### Description Fetch detailed usage history for request-level tables and billing visibility. This endpoint is best suited for teams building detailed billing tables and usage history pages, providing per-request model tracking. ### Method GET ### Endpoint /v1/usage/logs ### Query Parameters - **page** (integer) - Optional - Current page number. - **limit** (integer) - Optional - Page size. - **model** (string) - Optional - Filter by model id. - **from** (string) - Optional - Start date in ISO string format. - **to** (string) - Optional - End date in ISO string format. ### Request Example ```bash curl --request GET \ --url "https://api.midsync.dev/v1/usage/logs?page=1&limit=20" \ --header "Authorization: Bearer " ``` ### Response #### Success Response (200) - **logs** (array) - Array of usage records. - **id** (string) - Unique identifier for the log entry. - **model** (string) - Model used for the request. - **mode** (string) - The mode of the request (e.g., 'responses'). - **pointsCharged** (number) - Points charged for that request when applicable. - **creditsConsumed** (number) - Credits consumed for the request. - **usage** (object) - Token or usage metrics when relevant. - **inputTokens** (integer) - Number of input tokens. - **outputTokens** (integer) - Number of output tokens. - **reasoningTokens** (integer) - Number of reasoning tokens. - **totalTokens** (integer) - Total tokens used. - **createdAt** (string) - Request timestamp in ISO format. - **pagination** (object) - Pagination details for the response. - **page** (integer) - Current page number. - **limit** (integer) - Page size. - **total** (integer) - Total number of records available. #### Response Example ```json { "logs": [ { "id": "log_123", "model": "gpt-5-4", "mode": "responses", "pointsCharged": 0.21, "creditsConsumed": 0.41, "usage": { "inputTokens": 2541, "outputTokens": 44, "reasoningTokens": 0, "totalTokens": 2585 }, "createdAt": "2026-04-12T10:30:00.000Z" } ], "pagination": { "page": 1, "limit": 20, "total": 100 } } ``` ``` -------------------------------- ### Fetch Usage Summary via cURL Source: https://midsync.dev/en/developers/docs/usage-summary-api Use this request to retrieve aggregated usage totals. Ensure the Authorization header includes a valid MidSync API key. ```bash curl --request GET \ --url "https://api.midsync.dev/v1/usage/summary" \ --header "Authorization: Bearer " ``` -------------------------------- ### POST /v1/videos/generations Source: https://midsync.dev/en/developers/docs/unified-video-api The public API-key video generation entry point for MidSync video models. This endpoint is best for teams integrating MidSync as an external developer API. ```APIDOC ## POST /v1/videos/generations ### Description This is the public task-creation endpoint for API-key customers. It allows for external developer integrations to generate videos using MidSync models. ### Method POST ### Endpoint https://api.midsync.dev/v1/videos/generations ### Parameters #### Query Parameters None #### Request Body - **model** (string) - Required - The video model to use (e.g., "seedance-1.5-pro"). - **prompt** (string) - Required - The text prompt for video generation. Length must be between 3 and 2500 characters. - **images** (array of strings) - Optional - An array of 0 to 2 image URLs. Use 0 for text-to-video and 1 to 2 for image-to-video. - **aspectRatio** (string) - Optional - The desired aspect ratio. Supports "1:1", "4:3", "3:4", "16:9", "9:16", "21:9", "2:3", "3:2". - **resolution** (string) - Optional - The desired resolution. Supports "480p", "720p", "1080p". - **duration** (integer) - Optional - The desired video duration in seconds. Supports 4, 8, 12. - **generateAudio** (boolean) - Optional - Whether to generate audio for the video. - **fixedLens** (boolean) - Optional - Whether to use a fixed lens effect. - **nsfwChecker** (boolean) - Optional - Whether to enable the NSFW checker. - **projectId** (string) - Optional - Internal context for the project. ### Request Example ```json { "model": "seedance-1.5-pro", "prompt": "A cinematic beach at sunset with gentle waves", "resolution": "720p", "aspectRatio": "16:9", "duration": 8, "generateAudio": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the request was successful. - **taskId** (string) - The unique identifier for the generated video task. - **providerTaskId** (string) - The task ID from the video generation provider. - **model** (string) - The model used for generation. - **providerModel** (string) - The specific model identifier from the provider. - **pointsCharged** (integer) - The number of points charged for the generation. - **status** (string) - The current status of the video generation task (e.g., "submitted"). - **estimatedTime** (string) - An estimated time for video completion. - **estimatedTimeSec** (integer) - An estimated time for video completion in seconds. #### Response Example ```json { "success": true, "taskId": "generated-task-id", "providerTaskId": "provider-task-id", "model": "seedance-1.5-pro", "providerModel": "bytedance/seedance-1.5-pro", "pointsCharged": 20, "status": "submitted", "estimatedTime": "~2-3 min", "estimatedTimeSec": 140 } ``` ``` -------------------------------- ### Public Video API - Generations Source: https://midsync.dev/en The public API-key video generation entry point for MidSync video models. ```APIDOC ## POST /v1/videos/generations ### Description Generates video based on provided parameters using various MidSync video models. ### Method POST ### Endpoint /v1/videos/generations ### Parameters #### Query Parameters - **api_key** (string) - Required - Your MidSync API key. #### Request Body - **model** (string) - Required - The name of the video model to use (e.g., "Seedance 1.5 Pro", "Kling 2.5 Turbo"). - **prompt** (string) - Required - The text prompt describing the desired video content. - **duration_seconds** (integer) - Optional - The desired duration of the video in seconds. - **resolution** (string) - Optional - The desired resolution of the video (e.g., "1080p", "720p"). - **image_url** (string) - Optional - URL of an image to use as a base for image-to-video generation. - **reference_task_id** (string) - Optional - Task ID for image-to-video generation when using models like Grok Video. ### Request Example ```json { "model": "Kling 2.5 Turbo", "prompt": "A futuristic cityscape at sunset", "duration_seconds": 5, "resolution": "1080p" } ``` ### Response #### Success Response (200) - **task_id** (string) - The ID of the video generation task. - **status** (string) - The current status of the task (e.g., "processing", "completed", "failed"). #### Response Example ```json { "task_id": "gen_abc123xyz", "status": "processing" } ``` ``` -------------------------------- ### Usage and Billing API Source: https://midsync.dev/en Endpoints for accessing usage logs and billing summaries for customer dashboards. ```APIDOC ## GET /v1/usage/logs ### Description Fetches detailed usage history for request-level tables and billing visibility. ### Method GET ### Endpoint /v1/usage/logs ### Parameters #### Query Parameters - **api_key** (string) - Required - Your MidSync API key. - **start_date** (string) - Optional - The start date for filtering usage logs (YYYY-MM-DD). - **end_date** (string) - Optional - The end date for filtering usage logs (YYYY-MM-DD). ### Response #### Success Response (200) - **logs** (array) - An array of usage log objects. - **timestamp** (string) - The time the usage occurred. - **model** (string) - The model used. - **duration_seconds** (number) - The duration of the usage in seconds. - **points_consumed** (number) - The number of points consumed. #### Response Example ```json { "logs": [ { "timestamp": "2023-10-27T10:00:00Z", "model": "Kling 2.5 Turbo", "duration_seconds": 5, "points_consumed": 100 } ] } ``` ## GET /v1/usage/summary ### Description Fetches aggregated usage totals for summary cards and dashboard views. ### Method GET ### Endpoint /v1/usage/summary ### Parameters #### Query Parameters - **api_key** (string) - Required - Your MidSync API key. - **start_date** (string) - Optional - The start date for filtering usage summary (YYYY-MM-DD). - **end_date** (string) - Optional - The end date for filtering usage summary (YYYY-MM-DD). ### Response #### Success Response (200) - **total_points_consumed** (number) - The total points consumed. - **total_duration_seconds** (number) - The total duration in seconds. - **breakdown_by_model** (object) - An object detailing points consumed per model. #### Response Example ```json { "total_points_consumed": 5000, "total_duration_seconds": 300, "breakdown_by_model": { "Kling 2.5 Turbo": 2000, "Seedance 1.5 Pro": 3000 } } ``` ``` -------------------------------- ### Usage Summary Response Shape Source: https://midsync.dev/en/developers/docs/usage-summary-api The expected JSON structure returned by the usage summary endpoint. ```json { "totalPointsCharged": 1234.56, "totalRequests": 321, "totalInputTokens": 120000, "totalOutputTokens": 45000, "byModel": [ { "model": "gpt-5-4", "requests": 120, "pointsCharged": 530.12 } ] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.