Translate API for Azure Translator in Foundry Tools 2025-10-01-preview using LLM + adaptiveDatasetId

Baz Heath 5 Reputation points

https://learn.microsoft.com/en-us/azure/ai-services/translator/custom-translator/azure-ai-foundry/concepts/adaptive-custom-translation

This implies that the adaptCT dataset indexes are to be used with the LLM deployment to fine tune translation output.

I have used the REST API to create the Adaptive DataSet Document and the index from it. The Id returned for the index is an int, but the translate API expects a string for the adaptiveDatasetId parameter. (https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/preview/translate-api)

using either the ID or the Name of the DataSet Index results in the following error:

Service request failed.
Status: 400 (Bad Request)
Content:
{"error":{"code":400134,"message":"The adaptive dataset ID in targets is invalid."}}

What is required to use the adaptCT functionality?

Thank you.

  1. Jerald Felix 13,500 Reputation points β€’ Volunteer Moderator

    Hello Baz Heath,

    Greetings!

    Thanks for raising this question in Q&A forum.

    The error "The adaptive dataset ID in targets is invalid" (error code 400134) is happening because the adaptiveDatasetId field in the Translate API does not accept the raw integer ID or the name returned by the dataset index creation API. It expects a specific string format that combines your workspace (project) ID and the index ID together. Let me walk you through the correct end-to-end process to get this working.

    Step 1: Make sure you are using the correct API version

    The adaptCT feature requires the preview API version. Ensure your Translate API call uses:

    api-version=2025-05-01-preview
    

    Step 2: Retrieve your Workspace ID

    Call the Get All Projects endpoint to get your workspaceId (this is a string GUID, not an integer):

    curl -X GET "https://<your-resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/workspaces/" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>"
    

    Note down the workspaceId from the response β€” you will need it in the next steps.

    Step 3: Retrieve your Dataset Index ID

    Call the Get All Dataset Indexes endpoint using your workspaceId:

    curl -X GET "https://<your-resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/index?workspaceId=<workspaceId>" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>"
    

    From the response, look for the id field of the index β€” note this value carefully as a string.

    Step 4: Use the correct adaptiveDatasetId format in the Translate API

    When calling the Translate API, pass the adaptiveDatasetId as a string in the targets array. The value should be the index ID string returned from the Get Dataset Index response (not the integer from creation, and not the index name). Here is an example:

    curl -X POST "https://<your-resource-name>.cognitiveservices.azure.com/translator/text/v3.0/translate?api-version=2025-05-01-preview&from=en&to=fr" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>" \
     -H "Content-Type: application/json" \
     -d "[{ \"Text\": \"Hello, how are you?\" }]" \
     --data-urlencode "adaptiveDatasetId=<your-index-id-as-string>"
    

    Step 5: Double-check these common mistakes

    1. Make sure the source and target languages in your dataset index exactly match the from and to parameters in the Translate API call (e.g., en to fr).
    2. Confirm your dataset index status is ready/active before using it β€” an index still being built will also cause this error.
    3. Ensure you are passing all three required headers: Ocp-Apim-Subscription-Key, Ocp-Apim-Subscription-Region, and for document operations, the Authorization: Bearer <token> header as well.

    Step 6: If the issue still persists

    Since this feature is currently in public preview, there may be undocumented behaviors or bugs. In that case:

    1. Open a support request via the Azure Portal against your Azure Translator / Foundry resource.
    2. Share the exact API request body you are sending (with keys redacted) along with the full error response.
    3. Request clarification on the correct adaptiveDatasetId string format expected by the 2025-05-01-preview Translate API.

    Quick Summary: The key thing to remember is β€” always use the string id field from the Get Dataset Index API response, and make sure your index is in a ready state before passing it to the Translate API. Do not use the integer returned at index creation time or the index name as the adaptiveDatasetId.

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards, Jerald Felix.Hello Baz Heath, Greetings! Thanks for raising this question in Q&A forum.

    The error "The adaptive dataset ID in targets is invalid" (error code 400134) is happening because the adaptiveDatasetId field in the Translate API does not accept the raw integer ID or the name returned by the dataset index creation API. It expects a specific string format that combines your workspace (project) ID and the index ID together. Let me walk you through the correct end-to-end process to get this working.

    Step 1: Make sure you are using the correct API version

    The adaptCT feature requires the preview API version. Ensure your Translate API call uses:

    api-version=2025-05-01-preview
    

    Step 2: Retrieve your Workspace ID

    Call the Get All Projects endpoint to get your workspaceId (this is a string GUID, not an integer):

    curl -X GET "https://<your-resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/workspaces/" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>"
    

    Note down the workspaceId from the response β€” you will need it in the next steps.

    Step 3: Retrieve your Dataset Index ID

    Call the Get All Dataset Indexes endpoint using your workspaceId:

    curl -X GET "https://<your-resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/index?workspaceId=<workspaceId>" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>"
    

    From the response, look for the id field of the index β€” note this value carefully as a string.

    Step 4: Use the correct adaptiveDatasetId format in the Translate API

    When calling the Translate API, pass the adaptiveDatasetId as a string in the targets array. The value should be the index ID string returned from the Get Dataset Index response (not the integer from creation, and not the index name). Here is an example:

    curl -X POST "https://<your-resource-name>.cognitiveservices.azure.com/translator/text/v3.0/translate?api-version=2025-05-01-preview&from=en&to=fr" \
     -H "Ocp-Apim-Subscription-Key: <your-key>" \
     -H "Ocp-Apim-Subscription-Region: <your-region>" \
     -H "Content-Type: application/json" \
     -d "[{ \"Text\": \"Hello, how are you?\" }]" \
     --data-urlencode "adaptiveDatasetId=<your-index-id-as-string>"
    

    Step 5: Double-check these common mistakes

    1. Make sure the source and target languages in your dataset index exactly match the from and to parameters in the Translate API call (e.g., en to fr).
    2. Confirm your dataset index status is ready/active before using it β€” an index still being built will also cause this error.
    3. Ensure you are passing all three required headers: Ocp-Apim-Subscription-Key, Ocp-Apim-Subscription-Region, and for document operations, the Authorization: Bearer <token> header as well.

    Step 6: If the issue still persists

    Since this feature is currently in public preview, there may be undocumented behaviors or bugs. In that case:

    1. Open a support request via the Azure Portal against your Azure Translator / Foundry resource.
    2. Share the exact API request body you are sending (with keys redacted) along with the full error response.
    3. Request clarification on the correct adaptiveDatasetId string format expected by the 2025-05-01-preview Translate API.

    Quick Summary: The key thing to remember is β€” always use the string id field from the Get Dataset Index API response, and make sure your index is in a ready state before passing it to the Translate API. Do not use the integer returned at index creation time or the index name as the adaptiveDatasetId.

    If this answer helps you kindly accept the answer which will help others who have similar questions.

    Best Regards,

    Jerald Felix.

  2. Baz Heath 5 Reputation points

    This is the response from the Get All Dataset Indexes endpoint:

    {
     "indexes": [
     {
     "id": 223,
     "name": "DtsDocs-en-es-edu-v1",
     "documents": [
     {
     "documentInfo": {
     "name": "DtsDocs-En-Es-mini-v1",
     "isParallel": true,
     "createdBy": null,
     "modifiedBy": null,
     "files": [],
     "languages": [],
     "createdDate": "2026-04-23T22:43:03.96",
     "isAvailable": true,
     "indexDocuments": null,
     "id": 1528020,
     "documentType": "Adaptive",
     "extractedSentenceCount": 0,
     "characterCount": 0,
     "usedByPrioritizedModel": null
     },
     "processedDocumentInfo": null
     }
     ],
     "createdBy": null,
     "createdDate": "2026-04-23T22:59:32.07",
     "status": "Linked",
     "apiDomain": "a0615c6a-9021-42af-9867-df13873f56a2-adaptive-DtsDocs-en-es-edu-v1",
     "sourceLanguage": "en",
     "targetLanguage": "es"
     }
     ]
    }
    
    

    Note, the id of the index is NOT a string. Using that value either as 223 or as "223" results in the same error.


Sign in to comment

1 answer

  1. Sina Salam 30,166 Reputation points β€’ Volunteer Moderator

    Hello Baz Heath,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that your Translate API for Azure Translator in Foundry Tools 2025-10-01-preview using LLM + adaptiveDatasetId is having issues.

    For complete and non-misleading steps for incorrect API usage and configuration mismatch, the best practices are to correct endpoint, the headers, format and version alignment. Follow the below steps to resolve all issues simultaneously:

    1. Use the official Translator endpoint only: https://api.cognitive.microsofttranslator.com is the documented global base URL for Text Translation v3.0, while regional or custom domains are used only for specific deployment scenarios such as geography control or private networking. - https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/v3/reference, and https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/v3/translate gives more insight.
    2. Stay on the stable version for production: use api-version=3.0, because the official preview uses api-version=2025-10-01-preview and introduces a different request contract that should not be mixed with GA calls.
    3. Send the required headers exactly as documented: Ocp-Apim-Subscription-Key, Content-Type: application/json; charset=UTF-8, and Ocp-Apim-Subscription-Region when the resource is regional or multi-service. - https://learn.microsoft.com/en-us/azure/ai-services/translator/text-translation/reference/v3/translate, https://docs.azure.cn/en-us/ai-services/translator/text-translation/reference/v3/reference
    4. Use the GA request body format, not the preview schema: for v3.0, send a JSON array such as [{ "Text": "Hello world" }]; the preview API instead expects an inputs object with targets, so mixing them causes request failures.
    5. A valid GA cURL call is: curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=fr" -H "Ocp-Apim-Subscription-Key: YOUR_KEY" -H "Ocp-Apim-Subscription-Region: YOUR_REGION" -H "Content-Type: application/json; charset=UTF-8" -d "[{\"Text\":\"Hello world\"}]".
    6. Verify the resource before testing: create either a Translator resource or an Azure AI multi-service resource, then copy the correct key, region, and endpoint from the Azure portal.
    7. If you are using Azure AI Foundry preview features, keep the contract separate: Foundry-based preview translation still uses Translator, but it requires the preview API version and the newer inputs / targets payload model.

    Troubleshoot in this order: 400 usually means invalid parameters or body, 401 means authentication is wrong, and path or endpoint mismatches should be corrected against the official request URL first; if the call still fails, recheck that the version, headers, and JSON schema match the exact API you selected.

    Official resources:

    I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

    1. Baz Heath 5 Reputation points

      Thanks for jumping in, but this question is specifically about the 2025-10-01-preview API and using the functionality that it supposedly contains. The 3.0 GA version does not contain this functionality, so using it does not resolve this issue. I am already using the 2025-10-01-preview API for every call, there is no mixing of API versions. What I really need is someone from the team who can explain the discrepancy between the documentation and the actual API contracts.

    2. Sina Salam 30,166 Reputation points β€’ Volunteer Moderator

      Hi Baz Heath,

      Thanks for your response.

      Regarding your need, I will therefore escalate the thread.

      However, you can contact: Priority Customer Support

      Cheers.

    3. Baz Heath 5 Reputation points

      Thank you. As a side note: here's an example of a Microsoft dev blog that describes how this should work.
      https://devblogs.microsoft.com/foundry/translation-customization-a-developers-guide-to-adaptive-custom-translation/#comments

    4. SRILAKSHMI C 19,110 Reputation points β€’ Microsoft External Staff β€’ Moderator

      Hi Baz Heath,

      Thank you for the clarification and you’re absolutely right to focus specifically on the 2025-10-01-preview API and the Adaptive Custom Translation (adaptCT) scenario.

      Based on what you’ve described and the testing you’ve already completed, your understanding and implementation approach look correct. The behavior you’re seeing points to a gap between the current documentation and the actual API contract/implementation for this preview feature.

      What we can confirm

      The adaptiveDatasetId parameter is expected as a string in the API contract.

      However, the dataset/index creation flow currently returns an integer ID, and there is no documented transformation or mapping provided.

      Passing either The numeric ID (even when cast to string), or The dataset/index name results in the 400134 - invalid adaptive dataset ID error.

      What this indicates

      At this time, this appears to be one of the following

      The preview feature requires an internal or different identifier format that is not yet documented or exposed

      There may be a missing linkage step between the dataset index and the LLM deployment before it can be used in the Translate API

      Or this is a known limitation / incomplete rollout of the adaptCT + LLM integration in the preview API

      Since this is a preview feature and your implementation aligns with the documentation, this needs confirmation from the product team.

      I am currently engaging the internal engineering team to:

      • Clarify the expected format for adaptiveDatasetId
      • Confirm whether any additional configuration or binding step is required
      • Validate whether this is a known issue or documentation gap

      At this stage, there isn’t a reliable workaround to enable adaptCT via the preview Translate API using the dataset ID returned from the current APIs.

      Thank you!

    5. Anshika Varshney 13,405 Reputation points β€’ Microsoft External Staff β€’ Moderator

      Hi Baz,

      Did you get any chance to review the response.

      Thankyou!


    Sign in to comment
Sign in to answer

Your answer