Migration Guide from the Legacy predictions Endpoint

circle-exclamation

If you use the native /predictions endpoint (For example: https://inference.de-txl.ionos.com/models/{modelId}/predictions), migrate to the OpenAI-compatible API for standard text and image generation use cases. The migration does not affect the /collections, /documents, and /query endpoints.

This migration simplifies integration with OpenAI-compatible tools and SDKs and provides a standardized developer experience.

Before you begin

To complete this migration you need:

  • An active IONOS AI Model Hub account with a valid API token.

  • A model ID for your use case, which you can retrieve from https://openai.inference.de-txl.ionos.com/v1/models.

  • An existing document collection. It is required for Retrieval Augmented Generation (RAG) only.

circle-exclamation

Migrate text generation

1

Update the endpoint URL

Replace the native endpoint with the OpenAI-compatible chat completions endpoint:

  • Before: POST https://inference.de-txl.ionos.com/models/{modelId}/predictions

  • After: POST https://openai.inference.de-txl.ionos.com/v1/chat/completions

circle-info

Note: Move the model ID from the URL to the request body. You can retrieve available IDs using https://openai.inference.de-txl.ionos.com/v1/models. Example: openai/gpt-oss-120b.

2

Restructure the request body

Before:

{
  "type": "prediction",
  "properties": {
    "input": "Please give me 5 domain suggestions for a flower shop in Berlin. Provide for each domain name a paragraph explaining the domain name and why it is valuable.",
    "options": {
      "max_length": "1000",
      "temperature": "0.5"
    }
  }
}

After:

{
  "model": "openai/gpt-oss-120b",
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "Please give me 5 domain suggestions for a flower shop in Berlin. Provide for each domain name a paragraph explaining the domain name and why it is valuable."
    }
  ],
  "max_tokens": 2000,
  "temperature": 0.5
}
3

Update field names

Native field
OpenAI-compatible field

properties.input

messages[].content (user role)

properties.options.max_length

max_tokens

properties.options.temperature

temperature

modelId in the URL

model in the request body

Migrate image generation

1

Update the endpoint URL

Replace the native endpoint with the OpenAI-compatible images endpoint:

  • Before: POST https://inference.de-txl.ionos.com/models/{modelId}/predictions

  • After: POST https://openai.inference.de-txl.ionos.com/v1/images/generations

circle-info

Note: You can retrieve available model IDs using https://openai.inference.de-txl.ionos.com/v1/models. Example: black-forest-labs/FLUX.1-schnell.

2

Restructure the request body

Before:

{
  "type": "prediction",
  "properties": {
    "input": "Draw an image of a futuristic city skyline at sunset, digital art.",
    "options": {
      "size": "1024x1024"
    }
  }
}

After:

{
  "model": "black-forest-labs/FLUX.1-schnell",
  "prompt": "A futuristic city skyline at sunset, digital art.",
  "n": 1,
  "size": "1024x1024"
}
3

Update field names

Native field

OpenAI-compatible field

properties.input

prompt

properties.options.size

size

modelId in the URL

model in the request body

Migrate retrieval augmented generation

Users requiring Retrieval-Augmented Generation (RAG) or document-based querying can now migrate to the native /query endpoint alongside the OpenAI-compatible API. This approach splits the process into two distinct steps:

1

Query your document collection

Endpoint: POST https://inference.de-txl.ionos.com/collections/{collectionId}/query

Request Body:

Response Example:

2

Generate a response using retrieved context

Endpoint: POST https://openai.inference.de-txl.ionos.com/v1/chat/completions

Request Body:

Last updated

Was this helpful?