curl --request POST \
--url https://api.zerogpu.ai/zeroclick/v1/chat/completions \
--header 'Content-Type: application/json' \
--header 'zc-signature: <api-key>' \
--data '
{
"model": "LFM2.5-1.2B-Instruct",
"messages": [
{
"role": "user",
"content": "Summarize the following article: ..."
}
]
}
'import requests
url = "https://api.zerogpu.ai/zeroclick/v1/chat/completions"
payload = {
"model": "LFM2.5-1.2B-Instruct",
"messages": [
{
"role": "user",
"content": "Summarize the following article: ..."
}
]
}
headers = {
"zc-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'zc-signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'LFM2.5-1.2B-Instruct',
messages: [{role: 'user', content: 'Summarize the following article: ...'}]
})
};
fetch('https://api.zerogpu.ai/zeroclick/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/zeroclick/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"LFM2.5-1.2B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize the following article: ...\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("zc-signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/zeroclick/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["zc-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"LFM2.5-1.2B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize the following article: ...\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "assistant",
"content": "<string>",
"annotations": [
"<unknown>"
]
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens_details": {}
}
}Chat completions (ZeroClick)
OpenAI-style chat inference authenticated by a ZeroClick HMAC signature instead of an API key.
curl --request POST \
--url https://api.zerogpu.ai/zeroclick/v1/chat/completions \
--header 'Content-Type: application/json' \
--header 'zc-signature: <api-key>' \
--data '
{
"model": "LFM2.5-1.2B-Instruct",
"messages": [
{
"role": "user",
"content": "Summarize the following article: ..."
}
]
}
'import requests
url = "https://api.zerogpu.ai/zeroclick/v1/chat/completions"
payload = {
"model": "LFM2.5-1.2B-Instruct",
"messages": [
{
"role": "user",
"content": "Summarize the following article: ..."
}
]
}
headers = {
"zc-signature": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'zc-signature': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'LFM2.5-1.2B-Instruct',
messages: [{role: 'user', content: 'Summarize the following article: ...'}]
})
};
fetch('https://api.zerogpu.ai/zeroclick/v1/chat/completions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));falsepackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.zerogpu.ai/zeroclick/v1/chat/completions"
payload := strings.NewReader("{\n \"model\": \"LFM2.5-1.2B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize the following article: ...\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("zc-signature", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.zerogpu.ai/zeroclick/v1/chat/completions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["zc-signature"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"LFM2.5-1.2B-Instruct\",\n \"messages\": [\n {\n \"role\": \"user\",\n \"content\": \"Summarize the following article: ...\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "chat.completion",
"created": 123,
"model": "<string>",
"choices": [
{
"index": 123,
"finish_reason": "<string>",
"message": {
"role": "assistant",
"content": "<string>",
"annotations": [
"<unknown>"
]
}
}
],
"usage": {
"prompt_tokens": 123,
"completion_tokens": 123,
"total_tokens": 123,
"prompt_tokens_details": {},
"completion_tokens_details": {}
}
}/v1/chat/completions — only authentication, authorization, and metering differ.
- Authentication — no
x-api-key. A buying agent calls ZeroClick’s hosted pay URL; ZeroClick proxies the request and signs the raw request bytes with an HMAC in thezc-signatureheader. A request is authenticated only by a valid signature. - Authorization — a ZeroClick allowance check runs before any billable work. It fails open on a transient ZeroClick outage (the signature has already verified), but never for a missing or invalid signature.
- Metering — actual token usage is settled with ZeroClick and reported via the
zc-usageresponse header. Stripe metering is bypassed; ZeroClick is the sole biller.
Authorizations
HMAC signature minted by ZeroClick over the raw request bytes, of the
form t=<unix-seconds>,kid=<key-id>,v1=<hex-hmac>. Verified by the
@zeroclickai/sellers SDK against the seller's signing secret keyed by
kid. A missing or invalid signature is rejected with 401
invalid_zeroclick_signature; this is never failed open.
Headers
ZeroClick request id, echoed in logs for correlation. Set by ZeroClick when it proxies the request.
"zcreq_1"
Identifier of the buying agent. Used to partition logs/analytics by agent; becomes the synthesized caller identity.
"agt_1"
Body
Model id; routes the request via model metadata. Kebab-cased into a ZeroClick service slug for metering.
"LFM2.5-1.2B-Instruct"
Candidate labels for text-classification models. May also be supplied via a system-role message.
Forwarded to the IAB cloud inference API only when the resolved model supports it.
Task-specific options. For GLiNER models this carries usecase,
schema, labels, threshold, mask, and replacement_char. For
moderation, threshold; for signal-extract, max_keywords.
Response
OpenAI Chat Completions response. Includes the zc-usage header settling actual usage with ZeroClick.
OpenAI Chat Completions response. For classification models, choices[0].message.content is a JSON-stringified classification result.
"chat.completion"
