> For the complete documentation index, see [llms.txt](https://docs.tumbler.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tumbler.app/subscription-contract/examples.md).

# Subscription examples

## Who this is for

Provider developers who need short working examples: what to return from the subscription URL and which link to show to the user.

## What you can do

* Validate a raw VLESS response.
* Validate a JSON `links/meta` response.
* Build `tumbler://add?link=...` for raw HTTPS and `crypt3`.

## Examples

* `text/plain` with VLESS links.
* JSON object with `links` and `meta`.
* Add link for the user.

## See also

* [getting-started/add-link.md](/getting-started/add-link.md)
* [subscription/response-formats.md](/subscription-contract/response-formats.md)
* [operations/caching-and-304.md](/after-first-launch/caching-and-304.md)
* [subscription/metadata.md](/subscription-contract/metadata.md)

## Minimal raw VLESS response

If your endpoint already returns `vless://...` lines, you can start here:

```http
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Cache-Control: public, max-age=300
ETag: "sub-u-123-v1"

vless://11111111-1111-1111-1111-111111111111@edge.example.com:443?security=reality&pbk=pk1&sid=s1&sni=edge.example.com#Edge-1
vless://22222222-2222-2222-2222-222222222222@backup.example.com:443?type=grpc#Backup
```

The Tumbler backend takes each valid VLESS line and extracts host, port, UUID, transport/security parameters, and the name after `#`.

## Raw VLESS with metadata

Metadata can be passed as `#key: value` lines before the links:

```
#profile-title: Provider Premium
#support-url: https://help.provider.example.com
#manage-url: https://account.provider.example.com
#subscription-userinfo: upload=123456; download=654321; total=10737418240; expire=1800000000
#balancer-method: ping
vless://11111111-1111-1111-1111-111111111111@edge.example.com:443?security=reality&pbk=pk1&sid=s1&sni=edge.example.com#Edge-1
vless://22222222-2222-2222-2222-222222222222@backup.example.com:443?type=grpc#Backup
```

## JSON `links/meta`

If JSON is more convenient, return the link array in `links` or `nodes`, and settings in `meta`:

```json
{
  "links": [
    "vless://11111111-1111-1111-1111-111111111111@edge.example.com:443?security=reality&pbk=pk1&sid=s1&sni=edge.example.com#Edge-1",
    "vless://22222222-2222-2222-2222-222222222222@backup.example.com:443?type=grpc#Backup"
  ],
  "meta": {
    "profile-title": "Provider Premium",
    "support-url": "https://help.provider.example.com",
    "manage-url": "https://account.provider.example.com",
    "subscription-userinfo": "upload=123456; download=654321; total=10737418240; expire=1800000000",
    "balancer-method": "ping"
  }
}
```

## Add link for a raw HTTPS URL

Source:

```
https://provider.example.com/sub/u_123
```

Add link:

```
tumbler://add?link=https%3A%2F%2Fprovider.example.com%2Fsub%2Fu_123
```

## Add link for crypt3

Source after encryption:

```
schema://crypt3/<token>
```

Add link:

```
tumbler://add?link=schema%3A%2F%2Fcrypt3%2F<token>
```

## Caching headers

```http
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Cache-Control: public, max-age=300
ETag: "sub-u-123-v1"
Last-Modified: Wed, 01 Jul 2026 09:00:00 GMT
```

When `If-None-Match` matches, you can return `304 Not Modified` without a body. See [caching-and-304.md](/after-first-launch/caching-and-304.md) for details.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.tumbler.app/subscription-contract/examples.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
