- API-Referenz
- AI hosting
- Get all ai hosting plans the authenticated user can access
Get all ai hosting plans the authenticated user can access
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
- customerIdstring
Restricts the list to plans of this organization.
- projectIdstring
Restricts the list to the plans of this project's organization. The caller still needs access to that organization.
- planIdstring
- searchTermstring
Case-insensitive substring match on the plan description.
- limitinteger (≥ 0)
The max count of resources to return in the list response.
- skipinteger
Number of items to skip. Should be multiple of
limit. - pageinteger (≥ 0)
Page to display.
skipandpageend up doing the same. If bothpageandskipare set, skip is used.
Responses
- 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.
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.
- customerIdstringrequired
- customerNamestringrequired
Denormalized name of the owning organization.
- descriptionstringrequired
- keysobjectrequired
- availableinteger (≥ -1)required
- planLimitinteger (≥ -1)required
- usedinteger (≥ 0)required
- maxParallelRequestsinteger
- nextTokenResetstring (date-time)required
- planIdstringrequired
- rateLimitobjectrequired
The number of allowed requests per unit. Limits are shared across all keys within the same project.
- allowedRequestsPerUnitintegerrequired
- unit"minute"required
- suspendedboolean
- tokensobjectrequired
- 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"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Your request ran into a rate limit. You have to wait until rate limit expires
- messagestring
- typestring
Content-Type: application/json
{
"message": "too many requests",
"type": "RateLimitError"
}
{
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "too many requests"
},
"type": {
"type": "string",
"example": "RateLimitError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
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();