Skip to main content

Create a chat completion

POST 

/v1/chat/completions

The HackAgent LLM gateway, in OpenAI's chat completions format: point an OpenAI client at https://api.hackagent.dev/v1 with a HackAgent API key. model picks one of HackAgent's models (GET /v1/models): hackagent/attacker-v1, which writes adversarial prompts, or hackagent/judge-v1, which judges responses. The response names that model only, never the upstream one.

Each call is charged to the organization's credits: its maximum cost (from max_tokens, capped at the model's limit) must be covered by the balance (402 otherwise), and its actual cost is deducted after it succeeds and logged (GET /apilogs). Streaming is not available (stream: true answers 501). Accepts an API key, a login token, or a cloud run's token, whose calls are charged to the run's organization. Errors use the gateway's own shape, {"error": ..., "code": ...}.

Request​

Responses​

OK