# Authentication Source: https://api-docs.streamskill.pro/api-reference/authentication Use your API Key to authenticate your requests ## Bearer Token StreamSkill API uses Bearer authentication with your API Key. You will have to send your API Key via the Authorization header. ``` Authorization: Bearer {YOUR_API_KEY} ``` Your API key can be accessed and managed in your [Security](https://streamskill.pro/en/cabinet/sessions) tab. ### Secure your API key > [!WARNING] > > Because API keys are not associated with an IP address and do not expire, they must be handled with care and should not be disclosed to third parties. Make sure to keep your API key secure. Do not share it in publicly accessible areas such as GitHub, client-side code, and so on. We recommend using environment variables or secrets to store your API key. > [!NOTE] > > If you suspect that your API key has been compromised, you can remove it in your [Security](https://streamskill.pro/en/cabinet/sessions) tab. # Data Modification Source: https://api-docs.streamskill.pro/api-reference/data-modification Modify responses to fit your needs ### Content types By default, the API returns a json response, but at the current time, we support the following response formats: * `json` - The default response format. * `xml` - The response in XML format. For example, to request a response in XML format, you can add the `Accept` header to your request: ```http theme={null} Accept: application/xml ``` ### Response fields You can specify which fields to return in the response by using the `fields` query parameter. This parameter accepts a comma-separated list of fields to include in the response. For example, to return only the `id` and `name` fields in the response, you can use the following query parameter: ```http theme={null} GET /purchases?fields=id,name ``` ### Additional fields You can also include additional fields in the response by using the `expand` query parameter. This parameter accepts a comma-separated list of fields to include in the response. For example, to include the `tarif` field in the response, you can use the following query parameter: ```http theme={null} GET /purchases?expand=tarif ``` > [!NOTE] > > You can combine the `fields` query parameter with the `expand` query parameter to receive attributes of related resources in the response. > > ```http theme={null} > GET /purchases?expand=tarif&fields=id,tarif.id > ``` # Get me Source: https://api-docs.streamskill.pro/api-reference/endpoints/basic GET /me # Bulk Start Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/bulk-start POST /purchases/bulk-start Start multiple purchases at once. Maximum 100 orders per request. # Bulk Stop Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/bulk-stop POST /purchases/bulk-stop Stop multiple purchases at once. Maximum 100 orders per request. # Delete purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/delete DELETE /purchases/{orderId} # Edit AI Chatbots Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/edit-ai-chatbots POST /purchases/{orderId}/edit-ai-chatbots Edit settings for an AI Chatbots order. Only works for orders where order_type is 'ai_chatbots'. # Edit chatbots Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/edit-chatbots POST /purchases/{orderId}/edit-chatbot # Edit Kick Viewers Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/edit-kick-viewers POST /purchases/{orderId}/edit-kick-viewers Edit settings for a Kick Viewers order. Only works for orders where order_type is 'viewers' and service is 'kick'. # Edit Twitch Followers Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/edit-twitch-followers POST /purchases/{orderId}/edit-twitch-followers Edit settings for a Twitch Followers order. Only works for orders where order_type is 'followers' and service is 'twitch'. Empty bodies and unchanged values are accepted and return ok. # Edit Twitch Viewers Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/edit-twitch-viewers POST /purchases/{orderId}/edit-twitch-viewers Edit settings for a Twitch Viewers order. Only works for orders where order_type is 'viewers' and service is 'twitch'. # Prolong purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/prolong POST /purchases/{orderId}/prolong # Start purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/start POST /purchases/{orderId}/start # Start chatbots Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/start-chatbots POST /purchases/{orderId}/start-chatbots # Stop purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/stop POST /purchases/{orderId}/stop # Stop chatbots Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/stop-chatbots POST /purchases/{orderId}/stop-chatbots # Upgrade viewers Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/upgrade-viewers POST /purchases/{orderId}/upgrade-viewers Increase an order's viewer limit. Use max_amount to set the maximum charge. 1. [Get a quote](/api-reference/endpoints/purchases/actions/upgrade-viewers-quote) for the new total viewer limit. 2. Send the same `target_viewers` and the quoted `amount` as `max_amount`. 3. Read the actual cost from `amount` and the payment ID from `payment_id`. If the cost exceeds `max_amount`, the API returns `409 price_changed` without applying the upgrade. Request a new quote before trying again. Omit `max_amount` or pass `null` to allow the upgrade without a spending limit. The new viewer limit also applies to future renewals. The upgrade does not extend the order duration. In the response, `status: "completed"` refers to the upgrade payment; the original order can continue running. # Quote viewers upgrade Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/actions/upgrade-viewers-quote POST /purchases/{orderId}/upgrade-viewers/quote Get the cost of increasing an order's viewer limit. The cost is based on the order's remaining time. This request does not charge your balance or change the order. `target_viewers` is the new total viewer limit. To increase an order from 100 to 200 viewers, send `200`. To apply the upgrade, call [Upgrade viewers](/api-reference/endpoints/purchases/actions/upgrade-viewers) with the same `target_viewers` and the returned `amount` as `max_amount`. The final cost is recalculated when you apply the upgrade. # Get all Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/all GET /purchases # Get bulk purchases Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/bulk GET /purchases/bulk # Create purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/create POST /purchases/create Use [Quote purchase](/api-reference/endpoints/purchases/quote) to check the cost before ordering. # Get purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/purchase GET /purchases/{orderId} # Quote purchase Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/quote POST /purchases/quote Calculate the order cost with your account's discounts and currency, without creating an order or charging your balance. Send the same `tarif` fields as [Create purchase](/api-reference/endpoints/purchases/create). The `tariff` alias and dotted keys such as `tarif.id` are also accepted. The price is recalculated at checkout. # Get uncompleted Source: https://api-docs.streamskill.pro/api-reference/endpoints/purchases/uncompleted GET /purchases/uncomplete # Get all Source: https://api-docs.streamskill.pro/api-reference/endpoints/services/all GET /services # Get service Source: https://api-docs.streamskill.pro/api-reference/endpoints/services/service GET /services/{serviceSlug} # Get all Source: https://api-docs.streamskill.pro/api-reference/endpoints/tariffs/all GET /tarifs ## Pricing Use [POST /purchases/quote](/api-reference/endpoints/purchases/quote) to get the final order total. To calculate it yourself, use the tariff's `pricing` object and the rules below. Prices are in `pricing.currency`, before discounts, for one hour (`hourly: true`) or one tariff period (`hourly: false`). | Type | Subtotal calculation | | - | - | | `standard` | Unit prices with separate quantity discounts for each range | | `fixed` | Price of a fixed-quantity package | | `graduated` | One price for the entire selected quantity, determined by its tier | `discount` is the effective percentage for your account and this tariff, including promotions. Use the returned value as-is. Quantity discounts are separate. Do not apply `/me.discount` again. For all three types, calculate the subtotal as described below, then: ```text theme={null} total = round(subtotal × duration × (1 - discount / 100), 2) ``` **Use `duration = 1` when `hourly: false`.** In the request, omit `duration` or send `1`. For hourly tariffs, use the requested number of hours; omitting `duration` also defaults to `1`. Round only the final total. Paid orders have a minimum total of `0.01`. ### Standard `price_per_unit` is the base price of one unit. `quantity_discounts` maps each range's first unit to a discount percentage. A range ends just before the next threshold; earlier units keep their discount. The returned schedule reflects your account's terms. An empty object `{}` means no quantity discount. ```json theme={null} { "type": "standard", "currency": "usd", "price_per_unit": 1, "quantity_discounts": {"1": 0, "100": 10}, "discount": 10 } ``` ```text theme={null} subtotal = sum(units_in_range × price_per_unit × (1 - range_discount / 100)) ``` The first 99 units cost **1 USD each**; from the 100th unit onward, each costs **0.90 USD**. The discount does not reprice earlier units. For 150 units, the subtotal is: `99 × 1 + 51 × 1 × 0.90 = 144.90 USD`. With no quantity discounts, the subtotal is simply `quantity × price_per_unit`. ### Fixed `price` covers the whole package. The tariff's `count` is fixed, so do not multiply by quantity. Quantity discounts do not apply. ```json theme={null} { "type": "fixed", "currency": "usd", "price": 100, "discount": 10 } ``` ```text theme={null} subtotal = price ``` With `duration = 1`, the total is **90 USD**. For an hourly package, multiply by the requested hours before applying the discount. ### Graduated `graduated_prices` maps quantity thresholds to prices for the entire selected quantity. Choose the highest threshold that does not exceed `quantity`. If the quantity is below every threshold, use the first tier. Do not add tier prices or multiply by quantity. Quantity discounts do not apply. ```json theme={null} { "type": "graduated", "currency": "usd", "graduated_prices": {"0": 100, "101": 150, "201": 200}, "discount": 10 } ``` ```text theme={null} subtotal = selected_tier_price ``` For 150 units, the subtotal is `150`. With `duration = 2` and `discount = 10`, the total is **270 USD**. ### Legacy fields Top-level `price`, `pricing_type`, `graduated_prices` and `discounts` remain for compatibility. Use `pricing` for new integrations. Unlike the prices inside `pricing`, top-level `price` and `graduated_prices` already include discounts and rounding. `price` covers the default quantity with `duration = 1`. The old `pricing_type` reports `standard` for both standard and fixed tariffs. # Get tariff Source: https://api-docs.streamskill.pro/api-reference/endpoints/tariffs/tariff GET /tarifs/{tarifId} ## Pricing Use [POST /purchases/quote](/api-reference/endpoints/purchases/quote) to get the final order total. To calculate it yourself, use the tariff's `pricing` object and the rules below. Prices are in `pricing.currency`, before discounts, for one hour (`hourly: true`) or one tariff period (`hourly: false`). | Type | Subtotal calculation | | - | - | | `standard` | Unit prices with separate quantity discounts for each range | | `fixed` | Price of a fixed-quantity package | | `graduated` | One price for the entire selected quantity, determined by its tier | `discount` is the effective percentage for your account and this tariff, including promotions. Use the returned value as-is. Quantity discounts are separate. Do not apply `/me.discount` again. For all three types, calculate the subtotal as described below, then: ```text theme={null} total = round(subtotal × duration × (1 - discount / 100), 2) ``` **Use `duration = 1` when `hourly: false`.** In the request, omit `duration` or send `1`. For hourly tariffs, use the requested number of hours; omitting `duration` also defaults to `1`. Round only the final total. Paid orders have a minimum total of `0.01`. ### Standard `price_per_unit` is the base price of one unit. `quantity_discounts` maps each range's first unit to a discount percentage. A range ends just before the next threshold; earlier units keep their discount. The returned schedule reflects your account's terms. An empty object `{}` means no quantity discount. ```json theme={null} { "type": "standard", "currency": "usd", "price_per_unit": 1, "quantity_discounts": {"1": 0, "100": 10}, "discount": 10 } ``` ```text theme={null} subtotal = sum(units_in_range × price_per_unit × (1 - range_discount / 100)) ``` The first 99 units cost **1 USD each**; from the 100th unit onward, each costs **0.90 USD**. The discount does not reprice earlier units. For 150 units, the subtotal is: `99 × 1 + 51 × 1 × 0.90 = 144.90 USD`. With no quantity discounts, the subtotal is simply `quantity × price_per_unit`. ### Fixed `price` covers the whole package. The tariff's `count` is fixed, so do not multiply by quantity. Quantity discounts do not apply. ```json theme={null} { "type": "fixed", "currency": "usd", "price": 100, "discount": 10 } ``` ```text theme={null} subtotal = price ``` With `duration = 1`, the total is **90 USD**. For an hourly package, multiply by the requested hours before applying the discount. ### Graduated `graduated_prices` maps quantity thresholds to prices for the entire selected quantity. Choose the highest threshold that does not exceed `quantity`. If the quantity is below every threshold, use the first tier. Do not add tier prices or multiply by quantity. Quantity discounts do not apply. ```json theme={null} { "type": "graduated", "currency": "usd", "graduated_prices": {"0": 100, "101": 150, "201": 200}, "discount": 10 } ``` ```text theme={null} subtotal = selected_tier_price ``` For 150 units, the subtotal is `150`. With `duration = 2` and `discount = 10`, the total is **270 USD**. ### Legacy fields Top-level `price`, `pricing_type`, `graduated_prices` and `discounts` remain for compatibility. Use `pricing` for new integrations. Unlike the prices inside `pricing`, top-level `price` and `graduated_prices` already include discounts and rounding. `price` covers the default quantity with `duration = 1`. The old `pricing_type` reports `standard` for both standard and fixed tariffs. # Errors and Rate Limiting Source: https://api-docs.streamskill.pro/api-reference/errors Learn about the different error codes and how to handle them The StreamSkill API uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the `2xx` range indicate success, codes in the `4xx` range indicate an error that failed given the information provided (e.g., a required parameter was omitted), and codes in the `5xx` range indicate an error with StreamSkill's servers. Error responses use the selected JSON or XML format and contain the following fields (But some errors provide additional fields): * `error_code` - A machine-readable identifier. Use it to distinguish errors with the same HTTP status. * `name` - The same localized text as `message`. * `message` - A human-readable message describing the error. * `code` - Almost always is 0. * `status` - Status code of the error. * `type` - Type of error that was returned. (e.g. `bad_request_http_exception`) ## Error codes | Code | Description | | - | - | | `400` | Bad Request - The request was invalid or cannot be served. (e.g., invalid JSON) | | `401` | Unauthorized - Unable to authenticate. | | `402` | Insufficient Funds - You don't have enough funds to do the request. | | `404` | Not Found - The specified resource could not be found. | | `405` | Method Not Allowed - Action is unavailable for this order. | | `406` | Not Acceptable - The requested response format is not supported. | | `409` | Conflict - For example, the order is completed or an upgrade exceeds `max_amount`. | | `422` | Validation Error - The request was well-formed but was unable to be followed due to validation errors. | | `429` | Too Many Requests - Rate limit exceeded. | | `500` | Server error - An unexpected error occurred. | | `502` | Service error - The request could not be completed. | ## Rate Limits Rate-limiting errors (`429`) happen when you are sending too many requests to the API. All API endpoints are rate-limited using a **Token Bucket** algorithm. ### Default Limits | User Type | Burst (max requests) | Refill Rate | | - | - | - | | Authenticated | 30 requests | 2 requests/sec | | Guest (no token) | 5 requests | 0.5 requests/sec | This means authenticated users can make up to 30 requests instantly, then 2 additional requests per second as tokens refill. ### Response Headers The API returns the following headers with every response: | Header | Description | | - | - | | `X-Rate-Limit-Limit` | Maximum number of requests (bucket capacity) | | `X-Rate-Limit-Remaining` | Requests remaining in current bucket | | `X-Rate-Limit-Reset` | Seconds until bucket is fully refilled (back to capacity) | On `429` responses, an additional header is returned: | Header | Description | | - | - | | `Retry-After` | Seconds to wait before the next request will be allowed | ### Handling Rate Limits When you receive a `429` response, wait for the number of seconds specified in the `Retry-After` header before retrying. #### Example 429 Response ``` HTTP/1.1 429 Too Many Requests X-Rate-Limit-Limit: 30 X-Rate-Limit-Remaining: 0 X-Rate-Limit-Reset: 15 Retry-After: 1 Content-Type: application/json; charset=UTF-8 ``` ```json theme={null} { "error_code": "too_many_requests", "name": "Rate limit exceeded.", "code": 0, "message": "Rate limit exceeded.", "status": 429, "type": "too_many_requests_http_exception" } ``` # Languages Source: https://api-docs.streamskill.pro/api-reference/languages List of supported languages By default, our API returns data in English. However, you can specify the language you want to receive data in by passing the `Accept-Language` header in your request. The following languages are supported: * English - `en` (default) * Russian - `ru` ## Example ```http theme={null} Accept-Language: ru ``` # Pagination Source: https://api-docs.streamskill.pro/api-reference/pagination Use pagination to return a limited set of results for each request By default, the API returns a maximum of 20 items per request. If you need more items, you can use query param `per-page` to specify the number of items to return per page. We also respond with a `Link` header that contains URLs to the current, first, last, previous, and next pages. Additionally, we include the total number of items, pages count and current page number in the response headers. ### Query Parameters * `page` - The page number to return. Default is 1. * `per-page` - The number of items to return per page. Default is 20. Allowed range is 1..100. ### Pagination Headers * `Link` - Contains URLs to pages. * `X-Pagination-Total-Count` - The total number of items. * `X-Pagination-Page-Count` - The total number of pages. * `X-Pagination-Current-Page` - The current page number. * `X-Pagination-Per-Page` - The number of items per page. ```http page theme={null} GET /v1/purchases?page=2 ``` ```http per-page theme={null} GET /v1/purchases?per-page=50 ``` ```http Response Headers theme={null} Link: ; rel=self, ; rel=first, ; rel=last, ; rel=prev, ; rel=next X-Pagination-Total-Count: 1000 X-Pagination-Page-Count: 500 X-Pagination-Current-Page: 2 X-Pagination-Per-Page: 20 ``` # Introduction Source: https://api-docs.streamskill.pro/introduction Welcome to the StreamSkill API documentation ![StreamSkill API Logo Light](https://mintcdn.com/streamskill/oxTKykKOOcnrUxeN/images/hero-light.svg?fit=max\&auto=format\&n=oxTKykKOOcnrUxeN\&q=85\&s=c57f641f61a1f1db0ce94ed3756dcbdb) ## Information Our site acts as an intermediary between your application and our working servers. Therefore, information about orders is cached on our server and updated every 15 seconds. ## Setup The first step is to register an account and create an API key. You can find your API key in the security tab. > [card] [Create an API key](https://streamskill.pro/en/cabinet/sessions) > > This could be done in your cabinet (security tab) > [card] [Read the documentation](/api-reference/authentication) > > Find out how to use our API