POST
/
v1
/
completions
curl --request POST \
  --url https://fastapi.mymagic.ai/v1/completions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "llama2_70b",
  "question": "<string>",
  "max_tokens": 123,
  "list_inputs": [
    "<string>"
  ],
  "storage_provider": "<string>",
  "bucket_name": "<string>",
  "session": "<string>",
  "system_prompt": "<string>",
  "role_arn": "<string>",
  "region": "<string>",
  "return_output": true,
  "input_json_file": "<string>",
  "structured_output": "<string>"
}'
{
  "status": "Submitted",
  "job_id": "<string>"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
model
enum<string>
required

The model name to use for processing the question

Available options:
llama2_70b,
llama3_70b,
llama2_7b,
codellama_70b,
mixtral_8x7,
mistral_7b
question
string
required

The user's question to be processed

max_tokens
integer
default: 10

Max output tokens for the response

list_inputs
string[]

Optionally list batch input contents as a list of strings

storage_provider
string

Storage where data is stored (e.g., 's3', 'gcs')

bucket_name
string

Name of the bucket for storing results

session
string

Session name for the request

system_prompt
string
default: Answer the question based only on the given content. Do not give explanations or examples. Do not continue generating more text after the answer.

Additional system prompt for processing the user's question

role_arn
string

AWS IAM role ARN for S3 access

region
string
default: eu-west-2

The region the bucket belongs to

return_output
boolean
default: false

Boolean indicating whether to return the output or not

input_json_file
string

The name of the input json file in your s3 bucket

structured_output
string

json schema for the response output

Response

200 - application/json
status
enum<string>
required
Available options:
Submitted
job_id
string
required

The job ID assigned to the submitted question