curl --request POST \
--url https://api.passy.ai/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "llama-3.3-70b-versatile",
"prompt": "Say this is a test",
"max_tokens": 100,
"temperature": 0.7
}
'{
"id": "cmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW",
"object": "text_completion",
"created": 1677664795,
"model": "llama-3.3-70b-versatile",
"choices": [
{
"text": " This is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}{
"error": {
"message": "Invalid value for 'temperature': must be between 0 and 2",
"type": "invalid_request_error",
"code": "invalid_parameter"
}
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Rate limit exceeded. Please try again later.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}Create Completion
Creates a completion for the provided prompt and parameters. This endpoint supports both streaming and non-streaming responses.
curl --request POST \
--url https://api.passy.ai/v1/completions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "llama-3.3-70b-versatile",
"prompt": "Say this is a test",
"max_tokens": 100,
"temperature": 0.7
}
'{
"id": "cmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW",
"object": "text_completion",
"created": 1677664795,
"model": "llama-3.3-70b-versatile",
"choices": [
{
"text": " This is indeed a test",
"index": 0,
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 7,
"total_tokens": 12
}
}{
"error": {
"message": "Invalid value for 'temperature': must be between 0 and 2",
"type": "invalid_request_error",
"code": "invalid_parameter"
}
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}{
"error": {
"message": "Rate limit exceeded. Please try again later.",
"type": "rate_limit_error",
"code": "rate_limit_exceeded"
}
}{
"error": {
"message": "Invalid API key provided",
"type": "invalid_request_error",
"code": "invalid_api_key"
}
}Authorizations
Enter your Passy API key. Get your key from the Passy dashboard at https://dash.passy.ai/
Body
ID of the model to use
"llama-3.3-70b-versatile"
The prompt(s) to generate completions for
"Say this is a test"
The maximum number of tokens to generate
x >= 1100
Sampling temperature between 0 and 2
0 <= x <= 20.7
Nucleus sampling parameter
0 <= x <= 11
Number of completions to generate
1 <= x <= 1281
Whether to stream back partial progress
false
Up to 4 sequences where the API will stop generating
"\n"
Penalty for new tokens based on presence in text so far
-2 <= x <= 20
Penalty for new tokens based on frequency in text so far
-2 <= x <= 20
Response
Successfully created completion
Unique identifier for the completion
"cmpl-7QyqpwdfhqwajicIEznoc6Q47XAyW"
Object type, always 'text_completion'
text_completion Unix timestamp (in seconds) when the completion was created
1677664795
The model used for completion
"llama-3.3-70b-versatile"
List of completion choices
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?

.png?fit=max&auto=format&n=kWt04qZJ2feLSVvu&q=85&s=025addac6f17d281b5a7490171c947c5)