### Request JSON output from xi.pe endpoints Source: https://xi.pe/llms.txt Send Accept: application/json (or add ?output=json) to any endpoint to get a structured JSON response, including errors. This is the easiest way to capture the delete token, which appears in the body. Not available on the ?input=form path, which always redirects. The default Accept: */* still returns the bare URL. ```bash $ curl -s -H 'Accept: application/json' --data-binary @- https://xi.pe/ <<< 'hi' {"url":"https://xi.pe/Ab3dEf","code":"Ab3dEf","delete_token":"kZ8...","size":3,"expires":"2026-08-23T00:12:58Z"} ``` ```bash $ curl -s -H 'Accept: application/json' https://xi.pe/Ab3dEf {"url":"https://xi.pe/Ab3dEf","code":"Ab3dEf","data":"hi","size":3,"created":"...","expires":"..."} ``` ```bash $ curl -s -H 'Accept: application/json' https://xi.pe/nopeXY {"error":"Not found or expired","status":404} ``` -------------------------------- ### GET https://xi.pe/{code} (with JSON output) Source: https://xi.pe/llms.txt Retrieves the content of a paste. By default, the response is the raw paste content. If you send Accept: application/json (or add ?output=json), the response is a JSON object containing the URL, code, data, size, created, and expires fields. ```APIDOC ## GET https://xi.pe/{code} (with JSON output) ### Description Retrieves the content of a paste. By default, the response is the raw paste content. If you send Accept: application/json (or add ?output=json), the response is a JSON object containing the URL, code, data, size, created, and expires fields. ### Method GET ### Endpoint https://xi.pe/{code} ### Parameters #### Path Parameters - **code** (string) - Required - The paste code (e.g., Ab3dEf). #### Query Parameters - **output** (string) - Optional - Set to `json` to receive a JSON response. Alternative to the Accept header. #### Headers - **Accept** (string) - Optional - Set to `application/json` to receive a JSON response. ### Request Example ``` curl -s -H 'Accept: application/json' https://xi.pe/Ab3dEf ``` ### Response #### Success Response (200) - **url** (string) - The full URL of the paste. - **code** (string) - The paste code. - **data** (string) - The paste content. - **size** (integer) - The size of the paste content in bytes. - **created** (string) - RFC 3339 timestamp of when the paste was created. - **expires** (string) - RFC 3339 timestamp of when the paste expires. #### Response Example ``` {"url":"https://xi.pe/Ab3dEf","code":"Ab3dEf","data":"hi","size":3,"created":"...","expires":"..."} ``` #### Error Response (404) - **error** (string) - Error message. - **status** (integer) - HTTP status code. #### Error Response Example ``` {"error":"Not found or expired","status":404} ``` ``` -------------------------------- ### GET /:id Source: https://xi.pe/llms.txt Fetches the stored paste content. The response is plain text by default for API clients, but can be customized with query parameters. ```APIDOC ## GET /:id ### Description Fetches the exact bytes stored for the paste. Returns plain text for API clients (based on User-Agent) and a viewer page for browsers. Query parameters can force the response format. ### Method GET ### Endpoint `https://xi.pe/:id` ### Parameters #### Path Parameters - **id** (string) - Required - The paste identifier. #### Query Parameters - **raw** (flag) - Optional - Forces plain text response. - **html** (flag) - Optional - Forces the HTML viewer page. - **md** (flag) - Optional - Renders the content as a formatted Markdown page. - **h** (string) - Optional - Specifies the language for syntax highlighting. Accepts canonical names or aliases. If omitted, no highlighting is applied. ### Request Example ``` curl https://xi.pe/Ab3dEf ``` ### Response #### Success Response (200) - Returns the stored bytes as `text/plain; charset=utf-8`. #### Response Example ``` [stored content] ``` ``` -------------------------------- ### Form post with ?input=form Source: https://xi.pe/llms.txt Use this command when your tooling only sends application/x-www-form-urlencoded. The text must be in a data field. The response is a 303 redirect; read the URL from the Location header. ```bash curl -si --data-urlencode data@file.txt 'https://xi.pe/?input=form' ``` -------------------------------- ### POST https://xi.pe/ Source: https://xi.pe/llms.txt Creates a paste from the request body. The response is a plain-text URL on a single line. Use --data-binary to preserve newlines. Content must be valid UTF-8. ```APIDOC ## POST https://xi.pe/ ### Description Creates a paste from the request body. The response is a plain-text URL on a single line. Use --data-binary to preserve newlines. Content must be valid UTF-8. ### Method POST ### Endpoint https://xi.pe/ ### Parameters #### Query Parameters - **long** (boolean) - Optional - If present, returns a 23-character code instead of the default 6-character code. - **ttl** (string) - Optional - Sets a custom expiration time. Format: a whole number followed by a unit (m, h, or d). Maximum is 7 days. Over 7 days or a bare number returns a 400 error. #### Request Body - **raw text** (string) - Required - The text to paste. Must be valid UTF-8. ### Request Example ``` curl --data-binary @- https://xi.pe/ <<'EOF' your text here EOF ``` ### Response #### Success Response (200) - **body** (string) - The full URL of the created paste, on a single line with a trailing newline. #### Response Example ``` https://xi.pe/Ab3dEf ``` ### Error Handling - **400** - Invalid UTF-8 or invalid ttl parameter. - **413** - Oversized content (when using form posts, this is reported as 400 Missing data field). ``` -------------------------------- ### Check a link without downloading it Source: https://xi.pe/llms.txt Use curl -I to send a HEAD request to a xi.pe paste URL. A 200 status means the paste exists, 404 means it's gone. The response includes X-Paste-Created and X-Paste-Expires headers as RFC 3339 timestamps. ```bash curl -I https://xi.pe/Ab3dEf ``` -------------------------------- ### Create a paste with TTL option Source: https://xi.pe/llms.txt Use ?ttl=1h to request a paste that expires in one hour. The response is still a short URL. The reply includes the X-Paste-Expires header. ```bash echo 'gone in an hour' | curl --data-binary @- 'https://xi.pe/?ttl=1h' ``` -------------------------------- ### POST https://xi.pe/ (with JSON output) Source: https://xi.pe/llms.txt Creates a new paste. By default, the response is a bare URL. If you send Accept: application/json (or add ?output=json), the response is a JSON object containing the URL, code, delete token, size, and expiration timestamp. The delete token is also available in the X-Delete-Token response header. ```APIDOC ## POST https://xi.pe/ (with JSON output) ### Description Creates a new paste. By default, the response is a bare URL. If you send Accept: application/json (or add ?output=json), the response is a JSON object containing the URL, code, delete token, size, and expiration timestamp. The delete token is also available in the X-Delete-Token response header. ### Method POST ### Endpoint https://xi.pe/ ### Parameters #### Query Parameters - **output** (string) - Optional - Set to `json` to receive a JSON response. Alternative to the Accept header. #### Headers - **Accept** (string) - Optional - Set to `application/json` to receive a JSON response. #### Request Body - The raw paste content (binary or text). ### Request Example ``` curl -s -H 'Accept: application/json' --data-binary @- https://xi.pe/ <<< 'hi' ``` ### Response #### Success Response (200) - **url** (string) - The full URL of the created paste. - **code** (string) - The paste code. - **delete_token** (string) - The delete token for the paste. - **size** (integer) - The size of the paste content in bytes. - **expires** (string) - RFC 3339 timestamp of when the paste expires. #### Response Example ``` {"url":"https://xi.pe/Ab3dEf","code":"Ab3dEf","delete_token":"kZ8...","size":3,"expires":"2026-08-23T00:12:58Z"} ``` ``` -------------------------------- ### Delete a paste with X-Delete-Token Source: https://xi.pe/llms.txt Creating a paste returns an X-Delete-Token header. To delete, send a DELETE request with that token. The token works only for that paste and cannot be recovered. Deleting is optional; pastes expire on their own. ```bash curl -sD- --data-binary @- https://xi.pe/ < file.txt # headers, then the URL ``` ```bash curl -X DELETE https://xi.pe/Ab3dEf -H "X-Delete-Token: " ``` -------------------------------- ### Create a paste with curl Source: https://xi.pe/llms.txt Use this curl command to create a paste by sending text via stdin. The response is a single line containing the short URL. Use --data-binary, not -d, to preserve newlines. ```bash curl --data-binary @- https://xi.pe/ <<'EOF' your text here EOF ``` -------------------------------- ### POST https://xi.pe/?input=form Source: https://xi.pe/llms.txt Creates a paste using application/x-www-form-urlencoded encoding. The text must be placed in a 'data' field. The response is a 303 redirect with the paste URL in the Location header. ```APIDOC ## POST https://xi.pe/?input=form ### Description Creates a paste using application/x-www-form-urlencoded encoding. The text must be placed in a 'data' field. The response is a 303 redirect with the paste URL in the Location header. ### Method POST ### Endpoint https://xi.pe/?input=form ### Parameters #### Query Parameters - **input** (string) - Required - Must be set to 'form' to enable form-encoded submissions. #### Request Body (form-encoded) - **data** (string) - Required - The text to paste. Must be URL-encoded. - **long** (string) - Optional - Set to '1' to get a 23-character code. - **ttl** (string) - Optional - Set to a value like '1h' to set a custom expiration. ### Request Example ``` curl -si --data-urlencode data@file.txt 'https://xi.pe/?input=form' ``` ### Response #### Success Response (303) - **Location** (string) - The path to the created paste, e.g., /Ab3dEf?from=success. - **X-Delete-Token** (string) - A token for deleting the paste. #### Response Example ``` HTTP/1.1 303 See Other Location: /Ab3dEf?from=success X-Delete-Token: ... ``` ### Error Handling - **400** - Missing data field or invalid ttl. - **413** - Oversized content (reported as 400 Missing data field). ``` -------------------------------- ### create_paste Source: https://xi.pe/llms.txt Creates a new paste. Returns a delete token in the result, which is the only time it is shown. ```APIDOC ## create_paste ### Description Creates a new paste. Returns a delete token in the result, which is the only time it is shown. ### Method MCP Tool ### Parameters - **content** (string) - Required - The content of the paste. - **ttl** (optional) - Optional - Time-to-live for the paste, shorter than the default 7 days. - **long** (optional) - Optional - If set, generates a 23-character code instead of the default 6-character code. ### Response Returns the delete token in the result. ``` -------------------------------- ### Response body for paste creation Source: https://xi.pe/llms.txt The full response body is a single line with the short URL and a trailing newline. No JSON envelope. ```text https://xi.pe/Ab3dEf ``` -------------------------------- ### HEAD https://xi.pe/{code} Source: https://xi.pe/llms.txt Checks if a paste link is still valid without downloading the content. Returns 200 if the paste exists, 404 if it is gone. The response includes X-Paste-Created and X-Paste-Expires headers as RFC 3339 timestamps. ```APIDOC ## HEAD https://xi.pe/{code} ### Description Checks if a paste link is still valid without downloading the content. Returns 200 if the paste exists, 404 if it is gone. The response includes X-Paste-Created and X-Paste-Expires headers as RFC 3339 timestamps. ### Method HEAD ### Endpoint https://xi.pe/{code} ### Parameters #### Path Parameters - **code** (string) - Required - The paste code (e.g., Ab3dEf). ### Response #### Success Response (200) - **X-Paste-Created** (string) - RFC 3339 timestamp of when the paste was created. - **X-Paste-Expires** (string) - RFC 3339 timestamp of when the paste expires. #### Error Response (404) - The paste is gone or expired. ### Example ``` curl -I https://xi.pe/Ab3dEf ``` ``` -------------------------------- ### DELETE https://xi.pe/{code} Source: https://xi.pe/llms.txt Deletes a paste early using the delete token that was returned in the X-Delete-Token header when the paste was created. The token works only for that specific paste and cannot be recovered if lost. ```APIDOC ## DELETE https://xi.pe/{code} ### Description Deletes a paste early using the delete token that was returned in the X-Delete-Token header when the paste was created. The token works only for that specific paste and cannot be recovered if lost. ### Method DELETE ### Endpoint https://xi.pe/{code} ### Parameters #### Path Parameters - **code** (string) - Required - The paste code (e.g., Ab3dEf). #### Headers - **X-Delete-Token** (string) - Required - The delete token for the paste. ### Example ``` curl -X DELETE https://xi.pe/Ab3dEf -H "X-Delete-Token: " ``` ``` -------------------------------- ### Capture URL in a shell variable Source: https://xi.pe/llms.txt This command pipes text into curl and captures the resulting URL in a shell variable. It works because the response is a single line with no extra output. ```bash URL=$(printf '%s' "$text" | curl -s --data-binary @- https://xi.pe/) ``` -------------------------------- ### read_paste Source: https://xi.pe/llms.txt Reads a paste by its code. ```APIDOC ## read_paste ### Description Reads a paste by its code. ### Method MCP Tool ### Parameters - **code** (string) - Required - The paste code to read. ### Response Returns the paste content. ``` -------------------------------- ### delete_paste Source: https://xi.pe/llms.txt Deletes a paste using its delete token. ```APIDOC ## delete_paste ### Description Deletes a paste using its delete token. ### Method MCP Tool ### Parameters - **delete_token** (string) - Required - The delete token returned when the paste was created. ### Response Confirmation of deletion. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.