API keys
Create and manage SWQoS API keys and separate credentials for the Management API
ZeroCopy uses separate credentials for SWQoS submission and account management. Shredstream receivers do not use API keys.
| Credential | Use | Where to create it |
|---|---|---|
| SWQoS API key | Submit transactions and bundles, and query the send service | Your team's API keys page |
| Management key | Manage keys, read usage and manage partner domains through /api/v1 | Your team's API keys page |
Keep both credentials in server code. An SWQoS API key cannot authenticate Management API requests.
SWQoS API keys
Create a team in the console, then choose Create API key.
Team admins and developers can create keys. Save the secret when it appears; it is shown
only once. By default, secrets are 32 characters: zc_live_ followed by 24 securely
generated random ASCII letters or digits. White label partners can request a
custom prefix for customer keys;
your team's own sending keys keep the default format.
Teams start with 10 sending-key slots. Paused keys count toward the limit; expired, revoked and white-label customer keys do not. To increase the limit, choose Request more slots on API keys. Enter the desired total, not the number of additional slots. The request stays on the page until reviewed. To rotate a key, create a replacement, update your application, then revoke the old key.
HTTP
Send the key in the x-api-key header. This keeps it out of request URLs.
The authentication reference covers compatibility
forms and their precedence.
Set SWQOS_API_KEY to your key. Rust and Go use the
example project; TypeScript uses fetch.
use serde_json::{Value, json};
use swqos_examples::swqos::{Result, required};
#[tokio::main]
async fn main() -> Result<()> {
let response = reqwest::Client::new()
.post("https://sol.zerocopy.sh")
.header("x-api-key", required("SWQOS_API_KEY")?)
.json(&json!({ "jsonrpc": "2.0", "id": 1, "method": "getTipAccounts" }))
.send()
.await?;
let status = response.status();
let body = response.text().await?;
let reply: Value = serde_json::from_str(&body)
.map_err(|error| format!("HTTP {status}: {error}; body: {body}"))?;
if !status.is_success() || reply.get("error").is_some_and(|error| !error.is_null()) {
return Err(format!("HTTP {status}: {reply}").into());
}
println!("{}", serde_json::to_string_pretty(&reply)?);
Ok(())
}All HTTP routes need a key except GET /health. Use HTTPS. Hosted endpoints do not
provide CORS headers. See the HTTP route reference.
QUIC
Put the key in the client certificate's first common name (CN). A self-signed
certificate works. Follow the QUIC connection setup for
ALPN and server certificate verification.
Local agent
The agent uses the key in its licensed executable.
Local HTTP and QUIC accept any key or none, and IPC carries none. A request header
cannot switch the agent to another key. Restrict access to these listeners.
Existing agent builds require a zc_live_ license key. White label customer keys with
custom prefixes are for hosted endpoints, not these builds.
Declared tips and refusals
Using a key does not enable declared tips. Ask for declared tip access and payment through Requests in the console first.
A missing, unknown or revoked key returns
unauthorized. Support can pause a key; it returns
key_paused until resumed. An overdue declared tip payment returns
payment_required on submissions; queries remain
available. Resolve payment through your agreed billing setup or
ask for help on Discord.
Management keys
Create a management key on your team's API keys page. Only team admins can create
or revoke these keys. Creation requires recent identity verification. Save the secret
when it appears. Management key secrets start with zc_mgmt_.
Choose a lifetime of 30, 90 or 365 days and the scopes the integration needs. You can restrict the key to IPv4 or IPv6 addresses and ranges. A team can have up to 25 live management keys.
Management keys belong to the team and keep working when their creator leaves or changes role. To change a key's scopes or restrictions, create a replacement, update the integration, then revoke the old key. Revocation, expiry and team closure stop management authentication.
Send the key as Authorization: Bearer YOUR_MANAGEMENT_KEY to the console's origin.
Use the Management API guide for examples and idempotent
requests, and the reference for endpoints and response fields.