Create Completion
Continue a prompt on a Base model. With stream: true, Server-Sent Events: one CompletionChunk per event, then [DONE]; with output_residual_stream, the last chunk has no choices and has the activations. If Inference fails, the error object with type upstream_error, the code that names the failure, and retryable; during a stream, that error is the last event before [DONE].
bearerAuthorizationBearer <token>An API key: Authorization: Bearer sk-acs-..., or a key of the old platform, acs-bm-.... A User makes and revokes keys in the App.
idempotency-key?stringA key of your choice, 1 to 255 characters, such as a UUID. A retry with the same key and the same request does the work once: it gets the first answer, and is never charged twice. Kept 24 hours, one set for each User across all their API keys.
1 <= length <= 255application/json- body
model?stringThe Base model: an id from GET /v1/models, such as llama-8b. Left out, the model that GET /v1/models marks default.
^[^\u0000]*$prompt*|array<integer>|array<>|array<array<integer>>Text or a list of token ids, or a list of several such prompts. Each prompt gets n choices: choice i of prompt p has the index p * n + i.
max_tokens?|Generate at most this many tokens for each choice, at most 32000 in all: the number of prompts × n × max_tokens. Without stream, at most 15600, what Inference finishes within the API's 14-minute window. Left out, it is the model's context left after the prompt, at most 32000 (15600 without stream); a request of more than one prompt, or with n above 1, must set it. Near the end of your token budget, the API lowers it to what fits and says so in X-Acs-Max-Tokens-Clamped. null is the same as leaving it out.
value <= 32000temperature?numberSample less likely tokens more often; 0 takes the most likely token each time. From 0 to 2, as vLLM takes it.
0 <= value <= 2n?integerHow many choices to generate for each prompt; at most 128 in all.
value <= 128echo?booleanPut the prompt before the generated text.
logprobs?|Return the log probabilities of this many top tokens; at most 100.
0 <= value <= 100prompt_logprobs?|vLLM: log probabilities of the prompt tokens, and of this many top tokens at each, at most 100, and 33554432 in all: prompt tokens × n × (this + 1), and logprobs + 1 more with echo. -1 for the whole vocabulary, for at most 256 prompt tokens in all × n (16 with output_residual_stream). The API counts a text's tokens with the model's tokenizer, as Inference does, and token ids exactly. Not with stream: true.
-1 <= value <= 100top_p?numberSample from the most likely tokens up to this probability; more than 0 and at most 1, as OpenAI and vLLM take it.
0 < value <= 1top_k?integervLLM: sample from this many most likely tokens; 0 or -1 for all.
-1 <= valuemin_p?numbervLLM: leave out tokens less likely than this fraction of the most likely; from 0 to 1.
0 <= value <= 1presence_penalty?numberMake a token that is already in the text less likely; from -2 to 2.
-2 <= value <= 2frequency_penalty?numberMake a token less likely each time it is already in the text; from -2 to 2.
-2 <= value <= 2repetition_penalty?numbervLLM: divide the scores of repeated tokens by this, more than 0; 1 for none.
0 < valueseed?|From 0. The same seed samples the same tokens; vLLM can still change one now and then when it batches requests.
0 <= valuestop?|array<>|Stop before any of these texts; at most 4.
stream?booleanSend Server-Sent Events as tokens arrive.
stream_options?|Only with stream: true.
priority?|||vLLM: a lower number runs first, from 0. Requests of equal priority wait in order of arrival. null is 0; a text of digits and true or false count as their number.
user?|Your id for the person who asked.
^[^\u0000]*$add_special_tokens?booleanvLLM: add the model's special tokens, such as BOS, to text.
output_residual_stream?|||array<>vllm-lens: return the residual stream at these layers, in any order, each once, or true for every layer of the model, or false for none. Layer 0 is the first, and the last is capabilities.n_layers - 1 in GET /v1/models. A capture is at most 33554432 numbers (64 MiB as bfloat16): layers × tokens × the model's hidden size, where the tokens are the prompt's (as the model's tokenizer counts them) and max_tokens. So layers × tokens is at most 8192 for llama-8b (hidden size 4096), 2048 for llama-405b (hidden size 16384), 10922 for trinity-truebase (hidden size 3072); a model that the catalogue does not have counts as its largest hidden size, 16384.
apply_steering_vectors?array<>|vllm-lens: add these vectors to the residual stream. At most 8 vectors, and 2097152 numbers in all (8 MiB as float32): layers × positions × the model's hidden size.
Completion
- response
id*stringobject*"text_completion""text_completion"created*integermodel*stringchoices*array<>usage*activations?|nullcurl -X POST 'https://api.v2.infra.acsresearch.org/v1/completions' \ -H 'Authorization: Bearer <API_KEY>' \ -H 'Content-Type: application/json' \ -d '{ "prompt": "string"}'{ "id": "string", "object": "text_completion", "created": 0, "model": "string", "choices": [ { "index": 0, "text": "string", "logprobs": { "text_offset": [ 0 ], "token_logprobs": [ 0 ], "tokens": [ "string" ], "top_logprobs": [ { "property1": 0, "property2": 0 } ] }, "finish_reason": "string", "stop_reason": "string", "prompt_logprobs": [ { "property1": { "logprob": 0, "rank": 0, "decoded_token": "string" }, "property2": { "logprob": 0, "rank": 0, "decoded_token": "string" } } ] } ], "usage": { "prompt_tokens": 0, "completion_tokens": 0, "total_tokens": 0 }, "activations": { "residual_stream": { "data": "string", "dtype": "string", "original_dtype": "string", "shape": [ 0 ], "compression": "zstd" } }}Get Model Status GET
Say whether the model's next request most likely starts at once (`warm`), or which stage its start has reached (`boot`). The API answers from what it saw and asks no Inference, so the route never starts a GPU.
Create Completion Job POST
Queue one completion to run on the server, also after your connection closes. The body is a body of POST /v1/completions that does not stream. The request is admitted first, as POST /v1/completions admits it: a model that the API does not serve answers 400 `model_not_found`, a value that admission refuses answers 400, and if the token budget cannot hold it, 429 `budget_exceeded`; nothing is queued. Send an `Idempotency-Key` so that a retry gets the same job: the same key with another request answers 409 `idempotency_conflict`.