IONOS Cloud - AI Model Hub API (1.0.0)

Download OpenAPI specification:Download

IONOS Cloud AI Model Hub API

An API to interact with various AI models running on the IONOS Cloud

Foundation Models

Browse and call foundation models.

Retrieve available AI models

Retreieve the list of AI models running on the IONOS AI Model Hub. The model identifier is then used with the /predictions endpoint.

Authorizations:
tokenAuth

Responses

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "items": [
    ]
}

Send a request to the selected AI model

Send a request to the AI model and receive the result. The endpoint is synchronous and will return as soon as the model generates the full reply.

Authorizations:
tokenAuth
path Parameters
modelId
required
string

The ID of the model.

Request Body schema: application/json

Prediction input

required
object (PredictionProperties)

Responses

Request samples

Content type
application/json
{
  • "type": "prediction",
  • "properties": {
    }
}

Response samples

Content type
application/json
{
  • "type": "prediction",
  • "metadata": {
    },
  • "properties": {
    }
}

Document Collections

Manage your custom document collections in a Vector Dababase.

Create a new collection

Create a new, empty document collection for storing documents

Authorizations:
tokenAuth
Request Body schema: application/json

Collection input

required
object

Collection properties.

Responses

Request samples

Content type
application/json
{
  • "type": "collection",
  • "properties": {
    }
}

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "properties": {
    },
  • "metadata": {
    }
}

Get all collections

Retrieve all stored document collections

Authorizations:
tokenAuth
query Parameters
limit
integer
Default: 100

The maximum number of collections to return - defaults to 100

offset
integer
Default: 0

The offset to start from - defaults to 0

Responses

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "items": [
    ]
}

Get collection

Returns the properties and metadata for the document collection

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Responses

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "properties": {
    },
  • "metadata": {
    }
}

Update an existing collection

Update collection details and metadata. No modification is done on the documents.

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Request Body schema: application/json

Collection input

required
object (CollectionPropertiesUpdate) non-empty

Collection properties.

Responses

Request samples

Content type
application/json
{
  • "type": "collection",
  • "properties": {
    }
}

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "properties": {
    }
}

Delete a collection and its documents

Delete a collection and all documents stored in it

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Responses

Response samples

Content type
application/json
{
  • "httpStatus": 400,
  • "messages": [
    ]
}

Get the list of documents stored in the collection

Get the list of documents stored in the collection

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

query Parameters
limit
integer
Default: 100

The maximum number of documents to return - defaults to 100

offset
integer
Default: 0

The offset to start from - defaults to 0

Responses

Response samples

Content type
application/json
{
  • "id": "63a7d335-209c-5a1e-a8b2-686772fe2e55",
  • "type": "collection",
  • "href": "<RESOURCE-URL>",
  • "items": [
    ]
}

Add documents to the collection

Add documents to the collection. Already existing documents will be replaced

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Request Body schema: application/json

Document input

required
Array of objects (DocumentCreate)

The list of all documents in a collection

Responses

Request samples

Content type
application/json
{
  • "type": "collection",
  • "items": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "collection_id",
  • "type": "collection",
  • "href": "collection_href",
  • "items": [
    ]
}

Prune all documents in a collection

Delete all documents from a collection, thus pruning it

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Responses

Response samples

Content type
application/json
{
  • "httpStatus": 400,
  • "messages": [
    ]
}

Get document details

Retreieve document's details.

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

documentId
required
string

The ID of the document.

Responses

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "document",
  • "href": "<RESOURCE-URL>",
  • "properties": {
    },
  • "metadata": {
    }
}

Update a document

Update a document

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

documentId
required
string

The ID of the document.

Request Body schema: application/json

Document input

required
object (DocumentProperties) non-empty

Document properties.

Responses

Request samples

Content type
application/json
{
  • "type": "document",
  • "properties": {
    }
}

Response samples

Content type
application/json
{
  • "id": "9fa7d335-209c-5a1e-a8b2-686772fe7a33",
  • "type": "document",
  • "href": "<RESOURCE-URL>",
  • "properties": {
    },
  • "metadata": {
    }
}

Delete a document

Remove a document from the collection

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

documentId
required
string

The ID of the document.

Responses

Response samples

Content type
application/json
{
  • "httpStatus": 400,
  • "messages": [
    ]
}

Query a collection / search for related content

Query a collection / search for related content. This endpoint is used to return relevant documents from a collection.

Authorizations:
tokenAuth
path Parameters
collectionId
required
string

The ID of the collection.

Request Body schema: application/json

Query string and parameters.

query
required
string non-empty

The string used to query the vector database.

limit
integer
Default: 10

The maximum number of matches to return.

Responses

Request samples

Content type
application/json
{
  • "limit": 5,
  • "query": "What is Managed Kubernetes?"
}

Response samples

Content type
application/json
{
  • "type": "result",
  • "metadata": {
    },
  • "properties": {
    }
}