Skip to content
HTTP Tweak API documentation

Developers API v1

Business API

Generate new importable configurations

Start here

Generate a configuration

Send a configuration document and receive importable text.

On this page

The Business API turns a JSON document into text that the app can import. Use it when your backend owns the source data and you want to generate a configuration on demand.

POST /api/business/v1/config/generate

You need a Business API key. A Client API key does not work here.

1. Build a small configuration

Use this JSON with your own SSH host and credentials. Saving it to a file is optional.

{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}

The server structure is the same public connection format used by the Client API. See connection examples for other protocols.

2. Generate the import text

Send the configuration directly as a raw JSON request body with Content-Type: application/json. No file is required. In Postman, select Body → raw → JSON and paste the configuration JSON. In your backend, serialize the configuration object as JSON and send it as the request body.

export BUSINESS_API_KEY='YOUR_BUSINESS_API_KEY'
curl --fail-with-body --request POST 'https://httptweak.com/api/business/v1/config/generate' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --data-raw '
{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
'

Alternatively, save the JSON above as configuration.json and use the command below. --data-binary @configuration.json reads the local file and sends its contents as the same raw JSON body; it does not upload a file using multipart/form-data.

export BUSINESS_API_KEY='YOUR_BUSINESS_API_KEY'
curl --fail-with-body --request POST 'https://httptweak.com/api/business/v1/config/generate' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --data-binary @configuration.json

On success, HTTP 200 has Content-Type: text/plain; charset=UTF-8. The body is the importable configuration itself. Copy it into the app's configuration import flow. Accept: application/json makes validation errors predictable; successful generation still returns plain text.

To save a successful response, use your backend's HTTP status check before writing it as a configuration file. Do not pass an error JSON body to the app as import text.

Request fields

Field Type Required / default
name string Required; up to 255 characters
servers array Optional; up to 100 server documents per request
tweaks array Optional; up to 100 tweak documents per request
message string or null Optional; installation message limit applies
support_contact string or null Support contact (optional). Contact details shown in password, HWID, and expiry prompts. Max 100 characters.
settings object Optional; configuration settings supply defaults
sharing.allow_reshare boolean Optional; defaults to false
owner.device_hwid string or null Optional; up to 32 characters
cloud_protected boolean Optional; defaults to false
export_to_cloud boolean Optional; defaults to false
is_one_time_import boolean Optional; only with export_to_cloud: true
expiry integer Optional; minutes until a cloud share expires, minimum 1; only with export_to_cloud: true

Each server needs name, tunnel, carrier, accepted_methods, and settings. Each tweak needs name, tunnels, carrier, and methods. Both support optional category and note. Their name/category limits are 100 characters, and notes allow 255 characters.

Messages support the placeholders below; values are resolved while the generated configuration is built.

Placeholder Value
{config_name} Configuration name.
{created_at} Creation date and time in YYYY-MM-DD HH:mm:ss format.
{created_date} Creation date in YYYY-MM-DD format.
{updated_at} Last-updated date and time in YYYY-MM-DD HH:mm:ss format.
{updated_date} Last-updated date in YYYY-MM-DD format.
{server_count} Number of servers included in the generated configuration.
{tweak_count} Number of tweaks included in the generated configuration.
{server_list} Server names in alphabetical order, separated by commas.
{tweak_list} Tweak names in alphabetical order, separated by commas.

The generator assigns fresh configuration and resource keys. Do not submit unique_key, database IDs, or an owner username. The owner username comes from your Business API account; version information comes from the installation's settings.

What success means

The configuration is built in memory. It is not saved to your panel's configuration list, and its generated key cannot be used with Client API resource endpoints.

Response header Meaning
X-Configuration-Key Generated configuration key
X-Cloud-Protected true or false
X-Export-Mode direct or cloud
Cache-Control no-store
X-DailyQuota-Remaining Remaining generation quota for this UTC day

Each valid generation consumes one daily unit after validation, including a request that subsequently fails during generation or delivery. Repeating the request generates a fresh configuration and consumes another unit. There is no idempotency-key mechanism.

Add features gradually

Cloud password, cloud hardware-lock, and cloud update modes require a saved panel configuration and cannot be enabled on generated configurations.

Generation is not an update endpoint

Every call creates a new configuration key and new server/tweak keys, even when you send the same name and connection details. Import the new result as a new configuration. Do not point an imported configuration's update URL at this generation endpoint: app update requests require the original key, and generation requires your private Business credential.

Use a saved panel configuration with cloud updates and the Client API when you need to maintain a configuration already distributed to users. A custom update URL is useful only if your own publishing process can serve a valid same-key export.

Generation validates document structure, not remote connectivity or whether a server/tweak pair matches. Empty resource arrays and tweak-only exports can be valid, but the apps need both a selected tweak and a compatible server to connect. Both resources must use a compatible carrier, tunnel variant, accepted method set, and category. Empty categories match each other; named categories need a shared token (case-insensitive, separated by semicolons or newlines).

Start here

Authentication

Create, use, and rotate the right key for your integration.

On this page

Every request needs your account's API key for this API. A configuration's unique key identifies a resource; it does not authenticate the request.

Create the right credential

API Get a key Scope
Business Business API account Generate importable configurations under your account

The full credential is displayed once when created or rotated. The panel stores its hash and a masked preview. If you lose the full key, rotate it and update your integration.

Send the key in a header

The recommended header on this installation is X-API-Key:

X-API-Key: YOUR_BUSINESS_API_KEY
Accept: application/json
Content-Type: application/json

Content-Type is needed when sending a JSON body.

You can alternatively send:

Authorization: Bearer YOUR_BUSINESS_API_KEY

When both headers are present, X-API-Key takes precedence. Credentials in a query string or request body are not accepted. Do not put these keys in a mobile app, browser bundle, public repository, or share link.

Rotate or revoke

Rotate a key in the corresponding account page, then replace the secret in your backend. The old credential stops working. Revoke it to stop access. Rotation does not reset your daily usage.

An inactive key or owner cannot use the API.

Business accounts can also be suspended by an administrator; rotating a key does not bypass a suspension.

Platform and language

Send Accept: application/json so validation failures are returned as JSON. Treat HTTP status, success, and structured error fields as the contract rather than comparing human-readable messages, which may be localized.

Business API

Delivery & Cloud Protect

Choose direct text, a cloud link, or protected delivery.

On this page

Business API generation returns direct import text by default. Two optional flags control protection and delivery independently.

Choose a delivery mode

cloud_protected export_to_cloud Result
false false Importable configuration text
true false Protected configuration text
false true Cloud share link
true true Protected cloud share link

Cloud Protect controls how protected configuration text is opened. Cloud export controls how it is delivered. Neither creates an editable panel configuration.

Add these fields to the top-level JSON in the generation guide:

{
  "export_to_cloud": true,
  "expiry": 60,
  "is_one_time_import": true
}

This fragment must be combined with the required name and your connection resources. Do not send it as the entire generation request.

The response is still text/plain, now containing an app configuration share link. Preserve the entire returned link, including its scheme, and give it to the app's import flow; it is not a Client API URL. expiry is a duration in minutes from generation, not a Unix timestamp or a configuration expiration date. Omit it for no explicit share expiration. One-time import is false by default; when enabled, the server consumes the share when it releases the content to an authorized import request. It does not wait for the app to confirm local storage, so a lost response can consume the share. A later fetch returns 409; an expired share returns 410.

Share content must fit the installation's maximum cloud export size. An oversized export returns 413; the generation quota has already been consumed.

Enable Cloud Protect

Add "cloud_protected": true to enable Cloud Protect. Importing a protected configuration requires an internet connection.

Three different expiration concepts

Setting Applies to
Generation expiry Availability of a cloud share, measured in minutes
settings.restrictions.expires_at The generated configuration's own expiration, an absolute UTC time
Cloud access record expire_date A saved configuration's password/device access record, expressed as YYYY-MM-DD

Set the configuration's own restriction when you want it to expire after it has been imported. Expiring a share only limits retrieval of the share.

Complete delivery requests

Set BUSINESS_API_KEY as shown in the Business quickstart. Each command below is a complete request, including a compatible direct SSH server and tweak. Replace the sample host and credentials before using the output. These are alternatives: each request generates a new configuration and consumes quota.

Create an unprotected cloud link that expires after 60 minutes:

curl --fail-with-body --request POST 'https://httptweak.com/api/business/v1/config/generate' \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
    "export_to_cloud": true,
    "expiry": 60
}
'

Protected import text

Create protected import text without a cloud share:

curl --fail-with-body --request POST 'https://httptweak.com/api/business/v1/config/generate' \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
    "cloud_protected": true
}
'

Create a protected cloud link that can be imported once and expires after 60 minutes:

curl --fail-with-body --request POST 'https://httptweak.com/api/business/v1/config/generate' \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My first configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
    "cloud_protected": true,
    "export_to_cloud": true,
    "expiry": 60,
    "is_one_time_import": true
}
'

All three return plain text on success. The first and third return a share link; the second returns import text. Check the HTTP status before giving the result to a user. Keep the entire returned value, including its scheme.

Reference

Configuration settings

Control access, restrictions, editing, and sharing.

On this page

Control access, restrictions, editing, and sharing.

Business API: POST /api/business/v1/config/generate → settings.

Updates default to none. Cloud updates and cloud password/device locks are unavailable for generated configurations.

Start with defaults

When creating a configuration, omit settings to use an enabled configuration without a password, device lock, or expiry date. Editing permissions, shared/custom resources, and banner hiding default to false. Access defaults to restricted, so locks and restrictions can be added later.

A small example that permits credential editing:

{
  "settings": {
    "permissions": {
      "edit": {"credentials": true}
    }
  }
}

Include this settings object in your request body. Credential editing also enables the server permission flag, but the app interprets the combination as permission to edit credentials only. Server addresses and the full tunnel profile remain locked.

Access and updates

Paths below are relative to settings.

Field Values Behavior
enabled boolean Defaults to true; false is preserved in the generated export
updates.mode none, url Defaults to none; cloud updates are unavailable
updates.url URL string, max 255 characters Required for updates.mode: "url"; use an HTTP(S) URL that returns an exported configuration with the same unique_key
access.mode restricted, open Defaults to restricted. Open access cannot be combined with password/device locks or access restrictions.
access.password.mode none, local Defaults to none; cloud locks are unavailable
access.password.verifier string Required only for local password mode
access.hwid.mode none, local Defaults to none; cloud locks are unavailable
access.hwid.allowed string array Required for local device locking; 1–1,000 distinct device IDs, up to 128 characters each, without whitespace or semicolons

The API accepts a plaintext password of up to 100 bytes in access.password.verifier and converts it to the app’s password verifier. A lowercase hexadecimal string of exactly 64 characters is treated as an existing verifier. An arbitrary SHA-256 hash is not necessarily compatible with the app.

{
  "settings": {
    "access": {
      "password": {"mode": "local", "verifier": "ReplaceThisPassword"}
    }
  }
}

Specify mode when choosing an update source or password/device lock type. Only send values that apply to the selected mode.

Restrictions

Field Type Meaning
restrictions.expires_at UTC string or null YYYY-MM-DDTHH:MM:SSZ; null means no expiration
restrictions.mobile_only boolean Restrict to mobile connectivity
restrictions.block_root boolean Block rooted devices
restrictions.require_store_install boolean Require store installation where supported by the app
restrictions.blocked_apps string array Up to 1,000 distinct app names or package IDs; max 255 characters each
restrictions.allowed_carrier_codes string array Up to 128 distinct mobile-operator codes, each containing 5–6 digits
{
  "settings": {
    "restrictions": {
      "expires_at": "2027-01-01T00:00:00Z",
      "block_root": true,
      "allowed_carrier_codes": ["51502", "51503"]
    }
  }
}

Use JSON booleans (true / false), not quoted strings. Lists must be JSON arrays. Send mobile-operator codes as strings to preserve leading zeroes.

Editing and display

All these fields are booleans and default to false:

Field Allows or controls
permissions.edit.server Editing server connection details when credentials is false; retains the authored identity and tunnel selection
permissions.edit.credentials Credential-only editing; sets the server flag too, while keeping endpoint/profile fields locked
permissions.edit.payload Editing tweak payload, SNI/TLS, DNS carrier values, and protocol tuning exposed by the app
permissions.edit.proxy Editing proxy values where the selected tunnel/carrier supports proxy methods
permissions.resources.use_shared Makes this configuration a source of shared servers and tweaks for other imported configurations
permissions.resources.show_shared Includes resources from other imported configurations that enable use_shared
permissions.resources.add_custom Allows local custom servers and tweaks in the recipient app
display.hide_banner Hiding the SSH banner

Shared resources retain their source configuration. Its access checks still apply when a recipient uses one of those resources. These flags do not publish resources to the panel's public server catalog. Local custom resources and permitted local edits stay on the recipient device.

For access.mode: "open", the generator clears individual edit permissions and add_custom along with locks and restrictions. Open access corresponds to the panel's Unlock All behavior: the apps can transfer the imported copy to the recipient as owner. Use restricted access with explicit permissions when you want recipients to make only selected edits; restricted access can still have no password or device lock.

Android and iOS restrictions

Restriction Android iOS
Local password, device lock, expiration Enforced for ordinary recipients Enforced for ordinary recipients
mobile_only Requires mobile connectivity Requires cellular connectivity
block_root Root checks Jailbreak checks
require_store_install Store-install checks App Store-install checks
blocked_apps Checks blocked applications Preserved in the document; not enforced
allowed_carrier_codes Provider Lock checks Preserved in the document; not enforced

Test access as an ordinary recipient. Verified configuration owners can bypass recipient restrictions, so importing as the owner is not a sufficient lock test. The app's displayed device ID is the value to use for device locks; it is different from an API key and from a raw device-registration identifier.

Sharing and owner metadata

Place these fields at the top level of your request, alongside settings:

{
  "sharing": {"allow_reshare": false},
  "owner": {"device_hwid": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}
}

sharing.allow_reshare defaults to false. The optional owner device ID can contain up to 32 characters. The owner’s username comes from the authenticated API account and cannot be supplied in the request.

Ready-to-send settings requests

The following requests generate a new configuration with the selected settings. Set BUSINESS_API_KEY to your Business API key and replace the sample connection details. Each request creates a fresh configuration; it does not edit a previously generated configuration. Cloud updates and cloud locks are unavailable.

Editing and shared resources

Allow credential, payload, and proxy editing while keeping server endpoints locked; allow shared and custom resources; hide the banner:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "permissions": {
      "edit": {
        "server": true,
        "credentials": true,
        "payload": true,
        "proxy": true
      },
      "resources": {
        "use_shared": true,
        "show_shared": true,
        "add_custom": true
      }
    },
    "display": {
      "hide_banner": true
    }
  }
}
'

Local locks and restrictions

Use local password and device locks, with a configuration expiration and platform restrictions. Replace the password, device ID, date, package names, and carrier codes before sending:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "access": {
      "mode": "restricted",
      "password": {
        "mode": "local",
        "verifier": "ReplaceThisPassword"
      },
      "hwid": {
        "mode": "local",
        "allowed": [
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        ]
      }
    },
    "restrictions": {
      "expires_at": "2027-12-31T23:59:59Z",
      "mobile_only": true,
      "block_root": true,
      "require_store_install": true,
      "blocked_apps": [
        "com.example.capture"
      ],
      "allowed_carrier_codes": [
        "51502"
      ]
    }
  }
}
'

Clear locks and restrictions

Generate or update a configuration without expiration, list restrictions, or local locks:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "access": {
      "password": {
        "mode": "none"
      },
      "hwid": {
        "mode": "none"
      }
    },
    "restrictions": {
      "expires_at": null,
      "mobile_only": false,
      "block_root": false,
      "require_store_install": false,
      "blocked_apps": [],
      "allowed_carrier_codes": []
    }
  }
}
'

Custom update URL

Use your own URL that serves a same-key exported configuration:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "updates": {
      "mode": "url",
      "url": "https://updates.example.com/subscriber.ht"
    }
  }
}
'

Disable updates

Disable automatic updates:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "updates": {
      "mode": "none"
    }
  }
}
'

Pause and resume

Choose whether the exported configuration is enabled. Recipients must receive the changed configuration; this is not an immediate disconnect command:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "enabled": false
  }
}
'
curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "enabled": true
  }
}
'

Open access

Choose open access only if you intend to give recipients control of their imported copy. This clears its locks, restrictions, and granular editing permissions:

curl --fail-with-body --request POST "https://httptweak.com/api/business/v1/config/generate" \
  --header 'Accept: application/json' \
  --header "X-API-Key: $BUSINESS_API_KEY" \
  --header 'Content-Type: application/json' \
  --data-raw '
{
    "name": "My configuration",
    "servers": [
        {
            "name": "My SSH server",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh.example.com"
                    ],
                    "ports": [
                        22
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Direct SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ],
  "settings": {
    "access": {
      "mode": "open",
      "password": {
        "mode": "none"
      },
      "hwid": {
        "mode": "none"
      }
    },
    "restrictions": {
      "expires_at": null,
      "mobile_only": false,
      "block_root": false,
      "require_store_install": false,
      "blocked_apps": [],
      "allowed_carrier_codes": []
    },
    "permissions": {
      "edit": {
        "server": false,
        "credentials": false,
        "payload": false,
        "proxy": false
      },
      "resources": {
        "add_custom": false
      }
    }
  }
}
'

Reference

Connection format

Understand tunnels, carriers, methods, and endpoint values.

On this page

Both APIs accept the same server and tweak connection documents. Use explicit objects and arrays; keep endpoints, credentials, and method values in their own fields.

Server and tweak at a glance

Part Server Tweak
Protocol tunnel: one family and variant tunnels: one or more families with variant arrays
Carrier carrier: type and server carrier settings carrier: type and client carrier settings
Methods accepted_methods: permitted method combinations methods: values for the chosen methods
Connection settings: endpoint, credentials, or profile Protocol-specific tuning belongs under tunnels

Tunnel families

family variant values
ssh default, bhttp, hcr
openvpn tcp, udp
v2ray vless, vmess, trojan, ss, socks, http, hysteria2, wireguard
hysteria default

A server uses {"family":"ssh","variant":"default"}. A tweak uses {"ssh":{"variants":["default"]}}. Select the exact profile protocol for V2Ray.

Carrier

Every connection needs carrier.type and carrier.settings.

Type Server settings Tweak settings
default Empty object {} Empty object {}
slowdns nameservers array and public_key resolvers array; optional kcp_window (1–4,096, default 512)
slipstream domains array of 1–16 distinct names resolvers and/or authoritative; optional keep_alive_ms and congestion_control
masterdns domains array; optional encryption_method and method-dependent encryption_key resolvers array; optional resolver_balancing_strategy, max_upload_mtu, and max_download_mtu

DNS carriers are available for SSH default, OpenVPN TCP, and the stream-capable V2Ray variants. Proxy methods are not available with DNS carriers. BHTTP, HCR, OpenVPN UDP, V2Ray Hysteria2, V2Ray WireGuard, and UDP Hysteria use the default carrier.

For SSH/OpenVPN with a DNS carrier, omit settings.endpoint; the server destination comes from the carrier. With the default carrier, supply the endpoint separately.

For SSH/OpenVPN DNS carriers only, optional settings.preserved_ports retains server ports while settings.endpoint is omitted. Use 1–1,000 distinct JSON integers from 1–65,535. These are not DNS resolver ports.

Accepted method combinations

A server's accepted_methods is a nonempty array of distinct combinations. Each combination is an array containing zero or more of payload, proxy, and tls.

{
  "accepted_methods": [[], ["tls"], ["payload", "tls"]]
}

This permits direct, TLS, or payload plus TLS. It does not permit payload alone. [[]] means direct only. [] is invalid because it permits no connection at all.

The supported set depends on the tunnel and carrier. BHTTP, HCR, OpenVPN UDP, Hysteria2, and WireGuard accept direct only. UDP Hysteria supports direct or TLS. Stream protocols on the default carrier support payload, proxy, and TLS combinations; DNS carriers support payload/TLS combinations.

Tweak methods

A direct tweak uses "methods": {}. Here is a TLS-only method object:

{
  "methods": {
    "tls": {"sni": ["edge.example.com"], "version": "TLSv1.2"}
  }
}
Method Main fields
payload value: payload text; tokens such as [crlf] represent line breaks
tls sni: host array; version where supported
proxy hosts, ports; optional credentials.username and credentials.password

A tweak's method names must match one of the server's accepted combinations. SSH/OpenVPN connections offering TLS on the default carrier also need settings.tls_ports. For V2Ray payload/proxy/TLS methods, use a compatible RAW/TCP profile; the profile must support the chosen runtime method; API validation alone does not test that connection. See the dedicated examples.

Endpoints and credentials

SSH: use settings.endpoint.hosts, settings.endpoint.ports, and a settings.credentials object with username and password. Optional settings.private_key contains your existing SSH private key text, up to 1,000,000 characters.

OpenVPN: put the profile text in settings.profile, destinations in settings.endpoint, and login values in settings.credentials. Endpoint and transport selection are separate from profile text. Do not include remote, remote-random, proto, port, rport, or <connection> blocks in the API profile: express the destination in endpoint and the transport in tunnel.variant. Use client (or tls-client) and a TUN device, with inline certificates/keys instead of filesystem paths. A panel .ovpn import can extract this structure for you; the API expects it already separated. Optional fields include private_key_password and tls_ports.

V2Ray: put the share URI or supported raw profile in settings.profile. Its protocol must match tunnel.variant.

UDP Hysteria: use endpoint hosts and port_sets, an authentication string, and hop_interval_seconds (at least 8). Optional settings include bandwidth, ALPN, PEM CA certificates, obfuscation password, receive window, MTU discovery, and UDP idle timeout.

{
  "endpoint": {"hosts": ["ssh.example.com", "2001:db8::10"], "ports": [22, 2222]},
  "credentials": {"username": "demo", "password": "replace-me"}
}

This fragment belongs inside a server's settings. Host values contain only a hostname or IP: no URL scheme, port, or credentials. IPv6 addresses in host arrays are bare (2001:db8::10), without brackets. Port arrays contain 1–1,000 distinct JSON integers between 1 and 65,535. Host arrays contain 1–1,000 distinct entries of at most 253 characters. Hosts and ports are independent alternatives, not pairs matched by array position; do not join values with separators.

A Hysteria port set can contain individual ports and ranges:

{
  "endpoint": {
    "hosts": ["hy.example.com"],
    "port_sets": [[{"from": 443, "to": 443}, {"from": 5000, "to": 5100}]]
  }
}

Use connection examples for complete, copyable documents rather than submitting these field fragments on their own.

Transport tuning

These optional fields belong in the tweak, not in server credentials. Only include tuning for a selected tunnel variant. The defaults below describe what Android and iOS use when an optional value is omitted. To keep a chosen value independent of app defaults, send it explicitly.

Field Allowed value / unit Default when omitted
tunnels.ssh.bhttp.version Integer 1–2; select the version supported by your relay 2
tunnels.ssh.bhttp.chunk_size Integer 64–1,399 bytes per chunk 1399
tunnels.ssh.bhttp.download_batch Integer 1–32 records per download request 8
tunnels.ssh.bhttp.upload_workers Integer 1–64 concurrent upload workers 2
tunnels.ssh.bhttp.download_workers Integer 1–128 concurrent download workers 4
tunnels.ssh.hcr.mode hcr_v1 uses TLS; hcr_v1_plain uses a plain TCP relay connection hcr_v1
tunnels.ssh.hcr.download_batch Integer 1–32 records per download request 32
tunnels.ssh.hcr.upload_workers Integer 1–64 concurrent upload workers 16
tunnels.ssh.hcr.download_workers Integer 1–128 concurrent download workers 32
tunnels.v2ray.bug_hosts 1–1,000 distinct host candidates, max 253 characters each No substitution candidates; supply values when the profile uses [bughost]
methods.tls.version default, TLSv1.1, TLSv1.2, or TLSv1.3; UDP Hysteria allows only default because QUIC selects TLS default

For BHTTP and HCR, settings.endpoint.ports on the server is the relay listener port. BHTTP/HCR tuning belongs to the tweak. For V2Ray, bug_hosts supplies runtime host candidates; it does not change the profile protocol.

For SlowDNS, carrier.settings.resolvers accepts plain DNS addresses or udp://, https://, tls://, and dot:// resolvers. Server carrier.settings.nameservers contains DNS tunnel nameserver hosts; carrier.settings.public_key is the tunnel's public key. Optional tweak carrier.settings.kcp_window is a packet count from 1–4,096, default 512.

For Slipstream, use 1–16 total paths across carrier.settings.resolvers and carrier.settings.authoritative, with optional ports. Resolver paths accept numeric IP addresses or [local]; authoritative paths require numeric IP addresses. IPv6 with a port uses [2001:db8::10]:53 in these strings. Each domain must be a valid delegated DNS name shorter than 240 bytes. Server settings require domains and may include certificate, a single PEM leaf certificate of at most 16,384 characters.

Slipstream tweak field Allowed value / unit Default when omitted
carrier.settings.keep_alive_ms Integer 0–65,535 milliseconds; 0 disables keep-alive packets 400
carrier.settings.congestion_control bbr or dcubic; an explicit value overrides automatic selection Automatic: bbr on authoritative paths, dcubic on recursive resolver paths

For MasterDnsVPN, server carrier.settings.domains contains 1–16 distinct delegated DNS names, each at most 220 bytes.

carrier.settings.encryption_method is a JSON integer (default 5): 0 = no encryption, 1 = XOR, 2 = ChaCha20, 3 = AES-128-GCM, 4 = AES-192-GCM, 5 = AES-256-GCM. Omit carrier.settings.encryption_key for method 0. Otherwise, supply 16 characters for method 3, 24 for method 4, or 32 for methods 1, 2, and 5. Keys use printable ASCII characters without spaces and must match the remote server.

MasterDnsVPN tweak carrier.settings.resolvers requires 1–16 distinct numeric IP addresses or [local] (current network DNS), with optional ports from 1–65,535. For example: 1.1.1.1:53, [2001:db8::10]:53, or [local]:5353. DoH/DoT URLs are not accepted.

Optional MasterDnsVPN tweak values are JSON integers:

Field Allowed value / unit Default when omitted
carrier.settings.resolver_balancing_strategy Integer 0–8; meanings below 2
carrier.settings.max_upload_mtu Integer 38–512 bytes; maximum upload MTU 150
carrier.settings.max_download_mtu Integer 100–4,096 bytes; maximum download MTU 500

The negotiated MTU can be lower than these caps. These are DNS tunnel limits, not the device's network-interface MTU.

Balancing strategy Meaning
0 Round-robin compatibility mode; currently the same selection behavior as 2
1 Random selection among active resolver connections
2 Round-robin selection among active resolver connections
3 Prefer connections with the lowest measured loss
4 Prefer connections with the lowest measured latency
5 Prefer connections with the best combined loss and latency score
6 Shortlist low-loss connections, then prefer low latency within that group
7 Random selection within the best measured loss group
8 Round-robin selection within the best measured loss group

Measured strategies use round-robin until usable measurements are available. For a first configuration, omit the strategy or use 2; change it when you have measured resolver performance.

Hysteria tuning

Paths below are relative to server settings.

Field Allowed value / unit Default when omitted
authentication Required string, up to 65,535 characters Required; supply the value expected by your server
obfuscation_password Optional string, up to 65,535 characters No obfuscation password
bandwidth.upload_mbps, bandwidth.download_mbps Integers 1–1,000,000 megabits per second; provide both if supplying bandwidth 100 in each direction
hop_interval_seconds Required integer 8–2,147,483,647 seconds between port hops Required; no API default
receive_window Integer 1–4,096; receive-window multiplier, explained below 3
udp_idle_timeout_seconds Integer 4–120 seconds 20
disable_mtu_discovery JSON boolean false
alpn String, at most 255 UTF-8 bytes No override; the tunnel core chooses its default
ca Valid PEM certificates, at most 65,535 bytes No custom CA certificates

Each receive_window unit provides 65536 bytes of stream receive window and 163840 bytes of connection receive window. The default 3 therefore gives 196608 and 491520 bytes respectively. Send the multiplier, not either byte count.

Before testing a connection

A valid API document records how to connect; it does not provision remote services or prove they are reachable. SSH users, TLS listeners, proxies, DNS tunnel domains/keys, OpenVPN certificates, and V2Ray profiles must already match your infrastructure.

For a server and tweak used together, verify the tunnel variant, carrier, accepted method combination, and category matching (empty matches empty; named categories must share a token, ignoring case and surrounding spaces; separate tokens with semicolons or newlines). A direct method means no extra payload/proxy/TLS method; it does not disable encryption already supplied by SSH, an OpenVPN profile, or a V2Ray profile.

Field limits and complete values

Field Limit / requirement
SSH/OpenVPN settings.credentials Both username and password must be present as strings; each up to 65,535 characters
OpenVPN/V2Ray settings.profile Nonempty string, up to 10,000,000 characters; installation request-size limits still apply
OpenVPN settings.private_key_password Optional string, up to 65,535 characters
SSH settings.private_key_password Optional string, up to 1,000,000 characters
methods.payload.value Nonblank string; up to 100000 characters on this installation
methods.tls.sni, methods.proxy.hosts 1–1,000 distinct nonempty candidates, each up to 253 characters
methods.proxy.credentials If supplied, both username and password strings are required; each up to 65,535 characters
SlowDNS server nameservers 1–1,000 distinct hostnames/IPs, each up to 253 characters
SlowDNS tweak resolvers 1–1,000 distinct resolver strings, each up to 2,048 characters

Use full values for enabled methods: "tls": {} is a summary marker, not a valid authoring value. Send methods: {} only when no methods are enabled. One tweak's carrier and methods must be eligible for every selected family/variant; for example, a proxy tweak cannot also select OpenVPN UDP.

For OpenVPN, supply a complete usable profile with the necessary inline certificates/keys and options. Panel/API validation is structural; the apps also evaluate profiles with their bundled OpenVPN core. Passing API validation does not guarantee successful native parsing, authentication, or negotiation.

Reference

Payload & server placeholders

Use connection tokens in payloads, SNI, proxies, profiles, and DNS resolvers.

On this page

Keep connection placeholders as literal strings in Client API and Business API requests. The app resolves them when connecting, using the selected server, tweak, proxy, and network. They are field-specific: a token supported in a payload is not automatically supported in a server address or SNI.

Where placeholders work

Field Supported use
Tweak methods.payload.value HTTP payload tokens and controls described below, on a compatible payload connection
Tweak methods.proxy.hosts [host] reuses the selected server host; supply the proxy port separately in methods.proxy.ports
SSH/OpenVPN tweak methods.tls.sni [host] uses the selected server host; [proxy] uses the proxy host without its port
UDP Hysteria tweak methods.tls.sni Host tokens such as [host], [ip], [ssh_host], [rlb], [bughost], and [cf], including uppercase forms; [proxy] is not supported because UDP Hysteria has no tweak proxy
V2Ray server settings.profile [bughost] uses a selected value from the tweak's tunnels.v2ray.bug_hosts
SlowDNS/Slipstream/MasterDnsVPN tweak carrier.settings.resolvers [local] uses the current network's DNS address

Use actual hostnames or IP addresses in server endpoint arrays. For V2Ray SNI and proxy fields, use explicit host values unless the chosen connection supports the desired substitution. See connection examples for compatible methods.

Payload tokens

The following reference describes SSH/OpenVPN payload connections. Use the spelling shown; do not assume every token accepts mixed or uppercase spelling.

Token Replacement / example
[host], [ip], [ssh_host] Destination host, for example ssh.example.com; [ip] does not force a DNS lookup
[port], [ssh_port] Destination port, for example 22
[host_port], [ip_port], [ssh] Destination host and port, for example ssh.example.com:22; IPv6 is bracketed
[proxy] Selected proxy address, including its port when supplied, for example proxy.example.com:8080
[proxy_host], [proxy_port] Proxy host and port separately; use [proxy_host] when a header needs only the hostname
[bughost], [rlb], [cf] Aliases for the destination host in these payloads; the V2Ray profile substitution is separate
[method], [protocol] Connection request method and HTTP version; these depend on the connection path
[raw], [real_raw] Connection request line followed by a blank line
[crlf], [cr], [lf], [lfcr] CR+LF, CR, LF, or LF+CR; normal HTTP headers use [crlf]
[ua] The client's user-agent value; it can differ between connection paths
[auth] Proxy authorization derived from configured proxy credentials; leave credentials in methods.proxy.credentials

For a compatible HTTP CONNECT proxy, this tweak method fragment targets the selected server. The proxy must permit that destination and port.

{
  "methods": {
    "proxy": {"hosts": ["proxy.example.com"], "ports": [8080]},
    "payload": {
      "value": "CONNECT [host_port] HTTP/1.1[crlf]Host: [host_port][crlf][crlf]"
    }
  }
}

V2Ray payload examples use [host], [port], [ua], and [crlf] for the payload destination. A profile's [bughost] is resolved from tunnels.v2ray.bug_hosts before connecting; it is not a universal replacement for every payload token. Use the V2Ray payload example with a compatible RAW/TCP profile and frontend.

Payload choices and write controls

These controls apply to SSH/OpenVPN payload connections. Choices select text; write controls divide the outgoing stream. A write boundary does not guarantee a separate TCP packet.

Syntax Behavior
[rotate=one.example;two.example] Cycles through alternatives on successive uses; rotation state can reset when the connection restarts
[random=one.example;two.example] Chooses one alternative randomly
[split] Splits writes and adds a one-second pause after the complete payload
[splitNoDelay], [instant_split] Splits writes without an added pause
[delay], [delay_split], [split_delay] Splits writes and pauses one second at that boundary

Keep the semicolons inside a choice token. API host and resolver candidates are separate JSON array entries, not one semicolon-separated string.

Local DNS resolver

Use lowercase [local] in SlowDNS, Slipstream, or MasterDnsVPN tweak resolver fields. Both Android and iOS discover the current network's DNS address for each connection and keep the placeholder in the saved configuration. It does not mean localhost, the VPN server, or the panel server's DNS.

Value Use
[local] Network DNS with the default DNS port, 53
[local]:5353 Network DNS with an explicit port
udp://[local], udp://[local]:5353 SlowDNS UDP resolver forms; use the plain forms for Slipstream and MasterDnsVPN

In the panel resolver input, you can enter [local];8.8.8.8. In either API, send separate array values:

{
  "carrier": {
    "type": "slipstream",
    "settings": {"resolvers": ["[local]", "8.8.8.8:53"]}
  }
}

This is a tweak carrier fragment. [local] is not supported in Slipstream carrier.settings.authoritative, server DNS domains/nameservers, payloads, SNI, or ordinary server endpoint fields. If network DNS cannot be discovered when required, the app reports that local DNS is unavailable; adding a fixed resolver does not guarantee automatic fallback.

For MasterDnsVPN, the same placeholder works in carrier.settings.resolvers. Use plain numeric resolver addresses or [local], each with an optional port; URL schemes such as udp://, https://, and tls:// are not accepted:

{
  "carrier": {
    "type": "masterdns",
    "settings": {"resolvers": ["[local]:5353", "1.1.1.1:53"]}
  }
}

Configuration message placeholders

Connection tokens are separate from configuration message templates such as {config_name}. Message templates are rendered by the panel. See configuration message placeholders and the message reference in the tutorial.

Reference

Connection examples

Choose a tunnel and copy a complete server or tweak document.

Choose a protocol below to see a complete server or tweak body. All hostnames, passwords, public keys, and profiles are illustrative. Replace them with working values for your infrastructure.

How to use a sample

Business API: each sample is a complete generation request. Send it to POST /api/business/v1/config/generate with your Business API key. Examples that only demonstrate a shared tweak need your compatible server added before they are useful for connecting.

Start with Business generation quickstart if this is your first request. Some samples deliberately show multiple endpoint choices or advanced methods; the connection format explains each part.

Sample library

The library below uses the application's shared example definitions and converts them to the public JSON format. Expand a sample and copy the request body for this API. Samples remain available with JavaScript disabled.

OpenVPN TCP Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN TCP",
    "servers": [
        {
            "name": "OpenVPN",
            "tunnel": {
                "family": "openvpn",
                "variant": "tcp"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "vpn.example.com"
                    ],
                    "ports": [
                        1194
                    ]
                },
                "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "OpenVPN TCP",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "tcp"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
OpenVPN UDP Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN UDP",
    "servers": [
        {
            "name": "OpenVPN",
            "tunnel": {
                "family": "openvpn",
                "variant": "udp"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "vpn.example.com"
                    ],
                    "ports": [
                        1194
                    ]
                },
                "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ]
        }
    ],
    "tweaks": [
        {
            "name": "OpenVPN UDP",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "udp"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
OpenVPN TCP / UDP Shared tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN TCP / UDP",
    "servers": [],
    "tweaks": [
        {
            "name": "OpenVPN TCP / UDP",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "tcp",
                        "udp"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
OpenVPN / SSH Shared tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN / SSH",
    "servers": [],
    "tweaks": [
        {
            "name": "OpenVPN / SSH",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "tcp"
                    ]
                },
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                },
                "proxy": {
                    "hosts": [
                        "proxy.example.com"
                    ],
                    "ports": [
                        443,
                        444
                    ]
                }
            }
        }
    ]
}
SSH Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH",
    "servers": [
        {
            "name": "SSH",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "ssh1.example.com",
                        "ssh2.example.com"
                    ],
                    "ports": [
                        22,
                        2222
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                },
                "tls_ports": [
                    443,
                    8443
                ]
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "SSH",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                }
            }
        }
    ]
}
SSH BHTTP Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH BHTTP",
    "servers": [
        {
            "name": "BHTTP",
            "tunnel": {
                "family": "ssh",
                "variant": "bhttp"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "relay.example.com"
                    ],
                    "ports": [
                        8081
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ]
        }
    ],
    "tweaks": [
        {
            "name": "SSH BHTTP",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "bhttp"
                    ],
                    "bhttp": {
                        "version": 2,
                        "chunk_size": 1399,
                        "download_batch": 8,
                        "upload_workers": 2,
                        "download_workers": 4
                    }
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
SSH HCR Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH HCR",
    "servers": [
        {
            "name": "HCR",
            "tunnel": {
                "family": "ssh",
                "variant": "hcr"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "relay.example.com"
                    ],
                    "ports": [
                        8081
                    ]
                },
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ]
        }
    ],
    "tweaks": [
        {
            "name": "SSH HCR",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "hcr"
                    ],
                    "hcr": {
                        "mode": "hcr_v1",
                        "download_batch": 8,
                        "upload_workers": 2,
                        "download_workers": 4
                    }
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
SSH SlowDNS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH SlowDNS",
    "servers": [
        {
            "name": "SSH SlowDNS",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "settings": {
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "nameservers": [
                        "ns1.example.com",
                        "ns2.example.com"
                    ],
                    "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                }
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "SSH SlowDNS",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "resolvers": [
                        "https://dns.google/dns-query"
                    ],
                    "kcp_window": 512
                }
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                }
            }
        }
    ]
}
OpenVPN SlowDNS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN SlowDNS",
    "servers": [
        {
            "name": "OpenVPN SlowDNS",
            "tunnel": {
                "family": "openvpn",
                "variant": "tcp"
            },
            "settings": {
                "profile": "client\ndev tun\nauth-user-pass\nremote-cert-tls server\n",
                "credentials": {
                    "username": "demo",
                    "password": "secret"
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "nameservers": [
                        "ns1.example.com",
                        "ns2.example.com"
                    ],
                    "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                }
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "OpenVPN SlowDNS",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "tcp"
                    ]
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "resolvers": [
                        "https://dns.google/dns-query"
                    ],
                    "kcp_window": 512
                }
            },
            "methods": {}
        }
    ]
}
OpenVPN / SSH SlowDNS Shared tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "OpenVPN / SSH SlowDNS",
    "servers": [],
    "tweaks": [
        {
            "name": "OpenVPN / SSH SlowDNS",
            "tunnels": {
                "openvpn": {
                    "variants": [
                        "tcp"
                    ]
                },
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "resolvers": [
                        "https://dns.google/dns-query"
                    ],
                    "kcp_window": 512
                }
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                }
            }
        }
    ]
}
UDP Hysteria Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "UDP Hysteria",
    "servers": [
        {
            "name": "UDP Hysteria",
            "tunnel": {
                "family": "hysteria",
                "variant": "default"
            },
            "settings": {
                "endpoint": {
                    "hosts": [
                        "hy.example.com",
                        "2001:db8::10",
                        "2001:db8::11"
                    ],
                    "port_sets": [
                        [
                            {
                                "from": 443,
                                "to": 443
                            },
                            {
                                "from": 500,
                                "to": 3445
                            }
                        ],
                        [
                            {
                                "from": 3000,
                                "to": 4000
                            },
                            {
                                "from": 4500,
                                "to": 5000
                            }
                        ],
                        [
                            {
                                "from": 5670,
                                "to": 5670
                            }
                        ]
                    ]
                },
                "authentication": "auth-token",
                "obfuscation_password": "obfs-password",
                "bandwidth": {
                    "upload_mbps": 20,
                    "download_mbps": 50
                },
                "alpn": "h3",
                "hop_interval_seconds": 10
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "tls"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "UDP Hysteria",
            "tunnels": {
                "hysteria": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "tls": {
                    "sni": [
                        "hy.example.com"
                    ]
                }
            }
        }
    ]
}
V2Ray VLESS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray VLESS",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "vless"
            },
            "settings": {
                "profile": "vless://[email protected]:443?type=tcp&security=tls"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray VLESS",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "vless"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray VMESS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray VMESS",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "vmess"
            },
            "settings": {
                "profile": "vmess://eyJ2IjoiMiIsImFkZCI6InZtZXNzLmV4YW1wbGUuY29tIiwicG9ydCI6IjQ0MyIsImlkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwiYWlkIjoiMCIsIm5ldCI6InRjcCIsInRscyI6InRscyJ9"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray VMESS",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "vmess"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray HYSTERIA2 Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray HYSTERIA2",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "hysteria2"
            },
            "settings": {
                "profile": "hysteria2://[email protected]:443"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray HYSTERIA2",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "hysteria2"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray SOCKS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray SOCKS",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "socks"
            },
            "settings": {
                "profile": "socks://demo:[email protected]:1080"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray SOCKS",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "socks"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray HTTP Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray HTTP",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "http"
            },
            "settings": {
                "profile": "http://demo:[email protected]:8080"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray HTTP",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "http"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray SS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray SS",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "ss"
            },
            "settings": {
                "profile": "ss://[email protected]:8388"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray SS",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "ss"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray TROJAN Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray TROJAN",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "trojan"
            },
            "settings": {
                "profile": "trojan://[email protected]:443?type=tcp&security=tls"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray TROJAN",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "trojan"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray WIREGUARD Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray WIREGUARD",
    "servers": [
        {
            "name": "V2Ray",
            "tunnel": {
                "family": "v2ray",
                "variant": "wireguard"
            },
            "settings": {
                "profile": "[Interface]\nPrivateKey = YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWE=\nAddress = 10.0.0.2/32\n\n[Peer]\nPublicKey = YmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmJiYmI=\nEndpoint = wg.example.com:51820"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                []
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray WIREGUARD",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "wireguard"
                    ],
                    "bug_hosts": [
                        "edge.example.com"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {}
        }
    ]
}
V2Ray VLESS + Payload Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray VLESS + Payload",
    "servers": [
        {
            "name": "V2Ray RAW/TCP",
            "tunnel": {
                "family": "v2ray",
                "variant": "vless"
            },
            "settings": {
                "profile": "vless://[email protected]:443?type=tcp&security=tls"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray VLESS + Payload",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "vless"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                },
                "proxy": {
                    "hosts": [
                        "proxy.example.com"
                    ],
                    "ports": [
                        443,
                        444
                    ]
                }
            }
        }
    ]
}
V2Ray VMESS + Payload Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray VMESS + Payload",
    "servers": [
        {
            "name": "V2Ray RAW/TCP",
            "tunnel": {
                "family": "v2ray",
                "variant": "vmess"
            },
            "settings": {
                "profile": "vmess://eyJ2IjoiMiIsImFkZCI6InZtZXNzLmV4YW1wbGUuY29tIiwicG9ydCI6IjQ0MyIsImlkIjoiMTExMTExMTEtMTExMS00MTExLTgxMTEtMTExMTExMTExMTExIiwiYWlkIjoiMCIsIm5ldCI6InRjcCIsInRscyI6InRscyJ9"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray VMESS + Payload",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "vmess"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                },
                "proxy": {
                    "hosts": [
                        "proxy.example.com"
                    ],
                    "ports": [
                        443,
                        444
                    ]
                }
            }
        }
    ]
}
V2Ray TROJAN + Payload Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray TROJAN + Payload",
    "servers": [
        {
            "name": "V2Ray RAW/TCP",
            "tunnel": {
                "family": "v2ray",
                "variant": "trojan"
            },
            "settings": {
                "profile": "trojan://[email protected]:443?type=tcp&security=tls"
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "proxy"
                ],
                [
                    "payload",
                    "proxy"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ],
                [
                    "tls",
                    "proxy"
                ],
                [
                    "payload",
                    "tls",
                    "proxy"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray TROJAN + Payload",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "trojan"
                    ]
                }
            },
            "carrier": {
                "type": "default",
                "settings": {}
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                },
                "proxy": {
                    "hosts": [
                        "proxy.example.com"
                    ],
                    "ports": [
                        443,
                        444
                    ]
                }
            }
        }
    ]
}
V2Ray SlowDNS Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "V2Ray SlowDNS",
    "servers": [
        {
            "name": "V2Ray SlowDNS",
            "tunnel": {
                "family": "v2ray",
                "variant": "vless"
            },
            "settings": {
                "profile": "vless://[email protected]:443?type=tcp&security=tls"
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "nameservers": [
                        "ns1.example.com",
                        "ns2.example.com"
                    ],
                    "public_key": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                }
            },
            "accepted_methods": [
                [],
                [
                    "payload"
                ],
                [
                    "tls"
                ],
                [
                    "payload",
                    "tls"
                ]
            ]
        }
    ],
    "tweaks": [
        {
            "name": "V2Ray SlowDNS",
            "tunnels": {
                "v2ray": {
                    "variants": [
                        "vless"
                    ]
                }
            },
            "carrier": {
                "type": "slowdns",
                "settings": {
                    "resolvers": [
                        "https://dns.google/dns-query"
                    ],
                    "kcp_window": 512
                }
            },
            "methods": {
                "payload": {
                    "value": "GET / HTTP/1.1[crlf]Host: edge.example.com[crlf][crlf]"
                },
                "tls": {
                    "sni": [
                        "edge.example.com"
                    ],
                    "version": "TLSv1.2"
                }
            }
        }
    ]
}
SSH Slipstream Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH Slipstream",
    "servers": [
        {
            "name": "SSH over Slipstream",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "slipstream",
                "settings": {
                    "domains": [
                        "tunnel.example.com"
                    ]
                }
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                }
            }
        }
    ],
    "tweaks": [
        {
            "name": "Slipstream",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "slipstream",
                "settings": {
                    "resolvers": [
                        "1.1.1.1:53"
                    ],
                    "keep_alive_ms": 400,
                    "congestion_control": "bbr"
                }
            },
            "methods": {}
        }
    ]
}
SSH MasterDnsVPN Server + tweak

Configuration

POST /api/business/v1/config/generate

{
    "name": "SSH MasterDnsVPN",
    "servers": [
        {
            "name": "SSH over MasterDnsVPN",
            "tunnel": {
                "family": "ssh",
                "variant": "default"
            },
            "carrier": {
                "type": "masterdns",
                "settings": {
                    "domains": [
                        "tunnel.example.com"
                    ],
                    "encryption_key": "00000000000000000000000000000000",
                    "encryption_method": 5
                }
            },
            "accepted_methods": [
                []
            ],
            "settings": {
                "credentials": {
                    "username": "demo",
                    "password": "replace-me"
                },
                "preserved_ports": [
                    22,
                    2222
                ]
            }
        }
    ],
    "tweaks": [
        {
            "name": "MasterDnsVPN",
            "tunnels": {
                "ssh": {
                    "variants": [
                        "default"
                    ]
                }
            },
            "carrier": {
                "type": "masterdns",
                "settings": {
                    "resolvers": [
                        "1.1.1.1:53",
                        "[2001:db8::10]:53",
                        "[local]:5353"
                    ],
                    "resolver_balancing_strategy": 6,
                    "max_upload_mtu": 180,
                    "max_download_mtu": 900
                }
            },
            "methods": {}
        }
    ]
}

Reference

Responses, errors & limits

Read responses, diagnose a failed request, and handle quotas.

On this page

Always inspect the HTTP status and content type before using a response. Errors are JSON.

Business generation returns plain text on success. Preserve that text as the importable configuration; do not parse it as a JSON success object.

JSON responses

Every API error returns success: false, a stable string error code, a human-readable message, and an errors object. errors is empty when there are no field errors. Rate/quota errors can also include their details and headers. This applies to validation, authentication, middleware failures, and unsupported methods.

{
  "success": false,
  "error": "validation_failed",
  "message": "The given data was invalid.",
  "errors": {
    "name": ["The name field is required."]
  }
}

Troubleshoot by status

Status Meaning What to do
200 Generation succeeded Preserve the plain text as an importable configuration
400 Invalid operation or malformed app request Check the endpoint's required input
401 Missing or invalid authentication Use the correct API key in a supported header; check rotation
403 Access unavailable or ownership denied Check account status and access permissions
404 Endpoint not found Check the generation endpoint path
405 This HTTP method is not supported Check the documented HTTP method and endpoint path; inspect the Allow header
409 A one-time share has already been consumed (app import) Generate or distribute a new share if another import is needed
410 Cloud share expired (app import) Obtain a new share; this does not alter previously imported copies
413 Cloud export exceeds the size limit Reduce generated content or use direct delivery
422 Validation failed Read each field in errors
429 Burst limit or daily quota reached Wait for Retry-After; inspect error and quota headers
500 Generation, delivery, or resource processing failed Preserve diagnostic information and check the outcome before retrying a mutation
503 API or quota service unavailable Respect Retry-After when present and retry later

Messages can be localized. Do not build control flow around a specific English sentence.

Burst limits

Business requests use their account-specific limiter; consult your Business account for the effective allowance.

Header Meaning
X-RateLimit-Limit Maximum attempts in the current rate window
X-RateLimit-Remaining Remaining attempts
X-RateLimit-Reset Reset Unix timestamp when supplied
Retry-After Seconds to wait before retrying

Repeated invalid Business authentication attempts have a separate IP-based limiter. An authentication_rate_limited error requires waiting even if you subsequently correct the key.

Daily quota

Quotas reset at 00:00 UTC and are separate from burst limits.

API When a unit is consumed
Business After request validation succeeds, before generation; later generation or delivery failures still count

The Business account page displays its effective rate and quota; installation settings and account overrides can change them.

Rotation does not reset usage.

Header Meaning
X-DailyQuota-Limit Daily allowance
X-DailyQuota-Used Units consumed today
X-DailyQuota-Remaining Units remaining today
X-DailyQuota-Reset Next reset as a Unix timestamp

Daily exhaustion returns HTTP 429 with error: "daily_quota_exceeded", quota details, and Retry-After. Read headers from the actual response rather than assuming the default quota applies to your account.

Retry without creating duplicates

Business generation creates fresh keys on each call and has no idempotency key. Repeating a successful request generates a new configuration and consumes another quota unit.

The API succeeds, but the app cannot connect

Symptom Check
App asks to add a tweak Add a matching tweak even for direct connections; use methods: {}
Server disappears after selecting a tweak Tunnel variant, carrier, exact accepted method set, and both categories; empty categories do not match named categories
Update reports a different configuration key Serve the original configuration; a new Business generation is a new identity
A restriction works on Android but not iOS Check the platform restriction table
A sample imports but cannot reach a host Replace placeholder profiles/credentials and configure the actual tunnel service; validation does not contact the remote server

Stable error codes

Code Typical status
invalid_request 400
unauthenticated 401
forbidden 403
not_found 404
method_not_allowed 405
conflict 409
payload_too_large 413
validation_failed 422
rate_limited, authentication_rate_limited, daily_quota_exceeded 429
internal_error 500
service_unavailable 503

More specific quota/service codes may accompany the same status. Handle unknown codes by HTTP status. Validation errors identify the request field; array paths include the item index, such as servers.0.settings.credentials.password.

HTTP Tweak developer documentation Current API contract