Zum Hauptinhalt springen

Get all ai hosting plans the authenticated user can access

GET/v2/ai-hostings
API-Version
v2
Request-Methode
GET
Operation-ID
ai-hosting-user-get-plans

Lists every AI hosting plan the user reaches through its organizations. A membership in one of a plan's projects alone grants no access to the plan. A user without any AI hosting gets an empty list, not an error.

Request​

Responses​

Response-Header
  • X-Pagination-Limitinteger

    The limit used to select the resources for the response

  • X-Pagination-Skipinteger

    The number of skipped items

  • X-Pagination-Pagenumber

    The calculate page of the list response. Refer to parameters to learn more.

  • X-Pagination-TotalCountinteger

    The total amount of items available in the remote ressource. Use this value in combination with the limit to calculate the available pages.

Format
application/json
Beschreibung

The list of plans the user can access.

  • Array[

    One AI hosting plan the authenticated user can reach through one of its organizations. A membership in one of the plan's projects alone grants no access to it.

    • *object

      One AI hosting plan the authenticated user can reach through one of its organizations. A membership in one of the plan's projects alone grants no access to it.

      • customerIdstring
        required
      • customerNamestring
        required

        Denormalized name of the owning organization.

      • descriptionstring
        required
      • keysobject
        required
        • availableinteger (≥ -1)
          required
        • planLimitinteger (≥ -1)
          required
        • usedinteger (≥ 0)
          required
      • maxParallelRequestsinteger
      • nextTokenResetstring (date-time)
        required
      • planIdstring
        required
      • rateLimitobject
        required

        The number of allowed requests per unit. Limits are shared across all keys within the same project.

        • allowedRequestsPerUnitinteger
          required
        • unit"minute"
          required
      • suspendedboolean
      • tokensobject
        required
        • availableinteger (≥ -1, int64)
          required
        • planLimitinteger (≥ -1, int64)
          required
        • usedinteger (≥ 0, int64)
          required
    ]
Content-Type: application/json

[
{
"customerId": "string",
"customerName": "string",
"description": "string",
"keys": {
"available": 123,
"planLimit": 123,
"used": 123
},
"maxParallelRequests": 123,
"nextTokenReset": "1985-10-26T01:21:00.000Z",
"planId": "string",
"rateLimit": {
"allowedRequestsPerUnit": 123,
"unit": "minute"
},
"suspended": true,
"tokens": {
"available": 123,
"planLimit": 123,
"used": 123
}
}
]
{
"items": {
"description": "One AI hosting plan the authenticated user can reach through one of its\norganizations. A membership in one of the plan's projects alone grants no\naccess to it.\n",
"properties": {
"customerId": {
"type": "string"
},
"customerName": {
"description": "Denormalized name of the owning organization.",
"type": "string"
},
"description": {
"type": "string"
},
"keys": {
"properties": {
"available": {
"minimum": -1,
"type": "integer"
},
"planLimit": {
"minimum": -1,
"type": "integer"
},
"used": {
"minimum": 0,
"type": "integer"
}
},
"required": [
"used",
"available",
"planLimit"
],
"type": "object"
},
"maxParallelRequests": {
"type": "integer"
},
"nextTokenReset": {
"format": "date-time",
"type": "string"
},
"planId": {
"type": "string"
},
"rateLimit": {
"description": "The number of allowed requests per unit. Limits are shared across all keys within the same project.",
"properties": {
"allowedRequestsPerUnit": {
"type": "integer"
},
"unit": {
"enum": [
"minute"
],
"type": "string"
}
},
"required": [
"allowedRequestsPerUnit",
"unit"
],
"type": "object"
},
"suspended": {
"default": false,
"type": "boolean"
},
"tokens": {
"properties": {
"available": {
"format": "int64",
"minimum": -1,
"type": "integer"
},
"planLimit": {
"format": "int64",
"minimum": -1,
"type": "integer"
},
"used": {
"format": "int64",
"minimum": 0,
"type": "integer"
}
},
"required": [
"used",
"available",
"planLimit"
],
"type": "object"
}
},
"required": [
"planId",
"customerId",
"customerName",
"description",
"keys",
"tokens",
"rateLimit",
"nextTokenReset"
],
"type": "object"
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/ai-hostings?customerId=string&projectId=string&planId=string&searchTerm=string&limit=50&page=1
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.aiHosting.aiHostingUserGetPlans({
"queryParameters": {
"customerId": "string",
"projectId": "string",
"planId": "string",
"searchTerm": "string",
"limit": 50,
"page": 1
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\AIHosting\AiHostingUserGetPlans\AiHostingUserGetPlansRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new AiHostingUserGetPlansRequest())
->withCustomerId("string")
->withProjectId("string")
->withPlanId("string")
->withSearchTerm("string")
->withLimit(50)
->withPage(1);
$response = $client->aiHosting()->aiHostingUserGetPlans($request);

var_dump($response->getBody();

Auf dieser Seite