API

The AI Model Studio can be used for inference tasks through API to be integrated into AI applications or for running more sophisticated evaluations. The following paragraphs explain how and which specifications the API can access.

Create an access token

Authentication to access your personal fine-tuned models in handled via bearer token. To create a token, click on your user name in the top right corner of the AI Model Studio web UI and navigate to Organizational Settings. API tokens will be created in the API Keys tab.

Endpoints

Create a Generation Job

POST https://studio.ionos.de/api/v1/organizations/<YOUR_ORGANIZATION_ID>/generate

Request Body:

{
  "model_id": MODEL_ID,
  "messages": [
    [
      {
        "role": "user",
        "content": "The capital of France is"
      }
    ]
  ],
  "temperature": 0.7,
  "max_tokens": 512
}

Response:

{
  "job_id": JOB_ID,
  "status": "CREATED",
  "message": "Generation job created successfully"
}

Retrieve the Generated Output

`GET` https://studio.ionos.de/api/v1/organizations/<YOUR_ORGANIZATION_ID>/generate/<JOB_ID>

Response:

{
  "job_id": JOB_ID,
  "job_status": "FINISHED",
  "total_tasks": 1,
  "completed_tasks": 1,
  "results": [
    {
      "task_index": 0,
      "status": "completed",
      "result": " Paris, known for its iconic Eiffel Tower, rich history, and vibrant culture."
    }
  ]
}

Last updated

Was this helpful?