Echo v1.0 1 credit / call
Echoes your request back — the hello-world of Ksty.ch, free to try.
- Base path
- /api/v1/echo
- Methods
- GET or POST — parameters are read identically from the query string or a JSON body
- Auth
- X-Api-Key header (never Authorization: Bearer)
- Price
- 1–2 credits per call, by endpoint · about $0.0010 at 1,000 credits/USD
- Free tier
- 100 credits, refilled every month — drawn down before your paid balance
- Test mode
- Supported — ksty_test_ keys call this API free of charge
- Rate limit
- 60 calls/minute per key by default, raisable per key
Echo API
The Echo API sends back whatever you send it, wrapped in the metadata the gateway saw while processing your request. It runs no upstream, touches no third party, and always succeeds — which is exactly what makes it the fastest way to prove your integration works end to end before you wire in a real API.
Why an echo endpoint exists
Every call on Ksty.ch passes through the same pipeline — key authentication, scope and region checks, rate limiting, then credit metering — before it reaches a handler. When you are setting up a new client, a failure anywhere in that chain looks identical from the outside: a non-200 response. Echo lets you isolate your half of the problem. If Echo returns 200 with your payload intact, then your key, headers, base URL and request encoding are all correct, and any failure against a real API is about that API's parameters rather than your plumbing.
What comes back
A successful call returns your parsed parameters under echo, alongside the request context the gateway attached:
POST /api/v1/echo
X-Api-Key: ksty_test_...
Content-Type: application/json
{"hello": "world"}
{
"echo": { "hello": "world" },
"endpoint": "",
"mode": "test",
"request_id": "req_8f21c..."
}
echo— your parameters exactly as the gateway parsed them, so you can confirm a GET query string or a POST body decodes the way you expect.endpoint— which sub-endpoint ran (empty for the root,delayfor the delay endpoint).mode—testfor aksty_test_key orlivefor aksty_live_key, so you can verify which credential you actually sent.request_id— the stable id for this call; log it and quote it to support.
Test vs live mode
Echo is sandbox-enabled, so a ksty_test_ key calls it for free and the response reports "mode": "test". Swap in a ksty_live_ key and the identical call is metered against your balance and reports "mode": "live". Running the same request under both keys is the simplest way to confirm your production and sandbox credentials are wired to the right environments before you flip a real integration live.
The delay endpoint
echo.delay echoes your payload after pausing for a number of seconds (0–5). Use it to exercise the timeout, backoff and retry behaviour of your client against a slow-but-successful response, without needing a real API that happens to be slow.
The delay endpoint costs 2 credits rather than 1, because it holds a worker for the duration of the pause. Keep
secondssmall in automated tests so you are not paying — or waiting — more than the scenario needs.
When to use it
- The first call from a new SDK, language or environment, to confirm auth and encoding.
- Verifying a key's mode (
testvslive) and capturing therequest_idformat for your logs. - Load-testing your own client's timeout and retry paths via
echo.delay.
Endpoints
Echo the request payload and metadata
curl -X POST "https://ksty.ch/api/v1/echo" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"message":"example"}'
<?php
$ch = curl_init('https://ksty.ch/api/v1/echo');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{ "message": "example"}',
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://ksty.ch/api/v1/echo', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"message": "example"
})
});
const data = await response.json();
import requests
response = requests.post(
'https://ksty.ch/api/v1/echo',
headers={'X-Api-Key': 'YOUR_API_KEY'},
json={
"message": "example"
},
)
data = response.json()
{
"echo": {
"message": "hello"
},
"endpoint": "",
"mode": "test",
"request_id": "req_8f21c4a0"
}
Echo after N seconds (max 5) — for testing client timeouts
Holds the response open for a fixed number of seconds before answering, so you can exercise the paths that only appear under latency: client read timeouts, retry logic, circuit breakers, and whether your worker pool copes with a slow upstream.
Values above 5 are clamped to 5 rather than rejected — a timeout test should not fail on a validation error. Note the delay happens after metering, so a call that your client abandons mid-flight has still been charged; that is the honest simulation of a real slow upstream.
1
curl -X POST "https://ksty.ch/api/v1/echo.delay" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"seconds":1}'
<?php
$ch = curl_init('https://ksty.ch/api/v1/echo.delay');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: YOUR_API_KEY',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => '{ "seconds": 1}',
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://ksty.ch/api/v1/echo.delay', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"seconds": 1
})
});
const data = await response.json();
import requests
response = requests.post(
'https://ksty.ch/api/v1/echo.delay',
headers={'X-Api-Key': 'YOUR_API_KEY'},
json={
"seconds": 1
},
)
data = response.json()
{
"echo": {
"seconds": 1
},
"delayed": 1
}
Errors
Errors are JSON with a stable error.code — branch on the code, never on
the message. Everything below carries the X-Request-Id of the failed call.
Requests rejected by this API are not charged, and a 502 after a
charge is refunded automatically.
Response headers
Every successful call reports its own cost, so you never have to guess what a request spent or reconcile it later.