All URIs are relative to https://dashboard.quantcdn.io, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| oaiChatCompletions() | POST /oai/v1/chat/completions | Create a chat completion (OpenAI-compatible) |
| oaiEmbeddings() | POST /oai/v1/embeddings | Create embeddings (OpenAI-compatible) |
| oaiGetModel() | GET /oai/v1/models/{model} | Retrieve a model (OpenAI-compatible) |
| oaiListModels() | GET /oai/v1/models | List available models (OpenAI-compatible) |
oaiChatCompletions($oai_chat_completions_request): \QuantClient\Model\OaiChatCompletions200ResponseCreate a chat completion (OpenAI-compatible)
Drop-in replacement for OpenAI's POST /v1/chat/completions. Point any OpenAI SDK at base_url=https:///oai/v1 and use a Quant API token (qc_...) as the api_key. Set stream: true to receive Server-Sent Events (chat.completion.chunk objects terminated by data: [DONE]); otherwise a single chat.completion object is returned. Supports tool/function calling and the standard tool_choice modes.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: BearerAuth
$config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new QuantClient\Api\OpenAICompatibilityApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$oai_chat_completions_request = new \QuantClient\Model\OaiChatCompletionsRequest(); // \QuantClient\Model\OaiChatCompletionsRequest
try {
$result = $apiInstance->oaiChatCompletions($oai_chat_completions_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpenAICompatibilityApi->oaiChatCompletions: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| oai_chat_completions_request | \QuantClient\Model\OaiChatCompletionsRequest |
\QuantClient\Model\OaiChatCompletions200Response
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
oaiEmbeddings($oai_embeddings_request): \QuantClient\Model\OaiEmbeddings200ResponseCreate embeddings (OpenAI-compatible)
Drop-in replacement for OpenAI's POST /v1/embeddings. Accepts a single string or an array of strings in input and returns a list of embedding objects.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: BearerAuth
$config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new QuantClient\Api\OpenAICompatibilityApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$oai_embeddings_request = new \QuantClient\Model\OaiEmbeddingsRequest(); // \QuantClient\Model\OaiEmbeddingsRequest
try {
$result = $apiInstance->oaiEmbeddings($oai_embeddings_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpenAICompatibilityApi->oaiEmbeddings: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| oai_embeddings_request | \QuantClient\Model\OaiEmbeddingsRequest |
\QuantClient\Model\OaiEmbeddings200Response
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
oaiGetModel($model): \QuantClient\Model\OaiGetModel200ResponseRetrieve a model (OpenAI-compatible)
Drop-in replacement for OpenAI's GET /v1/models/{model}.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: BearerAuth
$config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new QuantClient\Api\OpenAICompatibilityApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$model = amazon.nova-micro-v1:0; // string
try {
$result = $apiInstance->oaiGetModel($model);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpenAICompatibilityApi->oaiGetModel: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| model | string |
\QuantClient\Model\OaiGetModel200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
oaiListModels(): \QuantClient\Model\OaiListModels200ResponseList available models (OpenAI-compatible)
Drop-in replacement for OpenAI's GET /v1/models. Returns the model ids available to the organisation; pass one of these ids as model in chat/embeddings requests.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: BearerAuth
$config = QuantClient\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new QuantClient\Api\OpenAICompatibilityApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->oaiListModels();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OpenAICompatibilityApi->oaiListModels: ', $e->getMessage(), PHP_EOL;
}This endpoint does not need any parameter.
\QuantClient\Model\OaiListModels200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]