Dokumentation
ReferenceHTTP APISynchronousTrim audio

Trim audio

POST
/v1/audio/trim
AuthorizationBearer <token>

API key as a Bearer token (Authorization: Bearer ).

In: header

Header Parameters

Idempotency-Key*string

Client idempotency key (1–255 printable ASCII), unique per distinct request. Required: these endpoints are billed, so the key makes retries safe (same key + same body replays the original result instead of charging again).

Length1 <= length <= 255
X-Debug-Timing?string

Any non-empty value adds a Server-Timing header to the response

Request Body

application/json

source_url*string

Public http(s) URL of the source media

params?

Task-type-specific parameters

[key: string]?never

Response Body

application/json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X POST "https://api.fotovid.co/v1/audio/trim" \  -H "Idempotency-Key: string" \  -H "Content-Type: application/json" \  -d '{    "source_url": "string"  }'
{
  "duration": 10.5,
  "expires_at": "2026-07-16T12:34:56Z",
  "id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "type": "video.trim",
  "url": "https://cdn.fotovid.co/sync/9f8e7d/out.mp4?X-Amz-Expires=900&X-Amz-Signature=e3b0c44298fc1c14"
}
{
  "code": "VALIDATION_INVALID_ARGUMENT",
  "detail": "source_url is required",
  "errors": [
    {
      "code": "VALIDATION_INVALID_ARGUMENT",
      "field": "source_url",
      "message": "source_url is required"
    }
  ],
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 400,
  "title": "Validation Failed",
  "type": "https://api.fotovid.co/errors/validation"
}
{
  "code": "AUTH_UNAUTHORIZED",
  "detail": "Missing or invalid API key",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 401,
  "title": "Unauthorized",
  "type": "https://api.fotovid.co/errors/authentication"
}
{
  "code": "INSUFFICIENT_CREDITS",
  "detail": "Not enough credits to run this task",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 402,
  "title": "Payment Required",
  "type": "https://api.fotovid.co/errors/payment"
}
{
  "code": "RESOURCE_CONFLICT",
  "detail": "A request with this Idempotency-Key is already in progress",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 409,
  "title": "Conflict",
  "type": "https://api.fotovid.co/errors/conflict"
}
{
  "code": "REQUEST_BODY_TOO_LARGE",
  "detail": "The request body exceeds the maximum allowed size",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 413,
  "title": "Payload Too Large",
  "type": "https://api.fotovid.co/errors/too-large"
}
{
  "code": "CONTENT_TYPE_UNSUPPORTED",
  "detail": "The source media type is not supported",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 415,
  "title": "Unsupported Media Type",
  "type": "https://api.fotovid.co/errors/unsupported-media-type"
}
{
  "code": "IDEMPOTENCY_KEY_REUSE",
  "detail": "Idempotency-Key was already used for a different request",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 422,
  "title": "Idempotency Key Reuse",
  "type": "https://api.fotovid.co/errors/idempotency"
}
{
  "code": "RATE_LIMIT_EXCEEDED",
  "detail": "Rate limit exceeded; retry after the indicated delay",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 429,
  "title": "Too Many Requests",
  "type": "https://api.fotovid.co/errors/rate-limit"
}
{
  "code": "INTERNAL",
  "detail": "An internal error occurred",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 500,
  "title": "Internal Server Error",
  "type": "https://api.fotovid.co/errors/internal"
}
{
  "code": "SOURCE_UNREACHABLE",
  "detail": "Could not fetch the source media",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 502,
  "title": "Source Unreachable",
  "type": "https://api.fotovid.co/errors/source-unreachable"
}
{
  "code": "SERVICE_UNAVAILABLE",
  "detail": "An internal error occurred",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 503,
  "title": "Service Unavailable",
  "type": "https://api.fotovid.co/errors/unavailable"
}
{
  "code": "PROCESSING_TIMEOUT",
  "detail": "Processing exceeded the synchronous time budget; use the async endpoint for large inputs",
  "instance": "/v1/audio/trim",
  "request_id": "01JR3F5Z0M8W2K9YQ7B4C6D8E0",
  "status": 504,
  "title": "Processing Timeout",
  "type": "https://api.fotovid.co/errors/processing-timeout"
}