From ee663fb2ba67be8b4a60be57d458817a12a6b35a Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Thu, 26 Sep 2024 19:02:01 +0530 Subject: [PATCH 01/11] initial commit --- src/apis/apiKeys.ts | 113 ++++++++++++++++++++++++++++++++++++++++++++ src/apis/index.ts | 3 +- src/client.ts | 2 +- 3 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 src/apis/apiKeys.ts diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts new file mode 100644 index 0000000..6d65558 --- /dev/null +++ b/src/apis/apiKeys.ts @@ -0,0 +1,113 @@ +import { ApiResource } from "../apiResource"; +import { APIResponseType, ApiClientInterface } from "../_types/generalTypes"; +import { APIPromise, RequestOptions } from "../baseClient"; +import { createHeaders } from "./createHeaders"; + +export interface ApiKeysCreateParams { + name: string; + config: Record; + isDefault: number; + workspace_id:string; +} + +export interface ApiKeysRetrieveParams { + slug: string; +} + +export interface ApiKeysUpdateParams { + slug?: string; + name?: string; + config?: Record; + status?: string; +} +export interface ApiKeysListParams { + page_size?: number; + current_page?: number; + workspace_id?: string; +} + +export interface ApiKeysCreateResponse extends APIResponseType { + success: boolean; + data: Record; +} +export interface ApiKeysRetrieveResponse extends APIResponseType { + success: boolean; + data: Record; +} +export interface ApiKeysListResponse extends APIResponseType { + sucess: boolean; + data: Record[]; +} +export interface ApiKeysUpdateResponse extends APIResponseType { + success: boolean; + data: Record; +} +function toQueryParams(params?: ApiKeysListResponse): string { + if (!params) { + return ''; + } + const queryParams = Object.entries(params) + .filter(([, value]) => value !== undefined && value !== null) + .map(([key, value]) => `${key}=${value}`) + .join('&'); + + return queryParams ? `?${queryParams}` : ''; +} +export class ApiKeys extends ApiResource { + constructor(client: any) { + super(client); + } + create( + _body: ApiKeysCreateParams, + params?: ApiClientInterface, + opts?: RequestOptions + ): APIPromise { + const body = _body; + if (params) { + this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } + } + const response = this.post('/configs', { body, ...opts }); + return response; + } + + retrieve( + _body: ApiKeysRetrieveParams, + params?: ApiClientInterface, + opts?: RequestOptions + ): APIPromise { + const body = _body; + const slug = body.slug; + if (params) { + this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } + } + const response = this.get(`/configs/${slug}`, { body, ...opts }); + return response; + } + + update( + _body: ApiKeysUpdateParams, + params?: ApiClientInterface, + opts?: RequestOptions + ): APIPromise { + const body = _body; + const slug = body.slug; + if (params) { + this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } + } + const response = this.put(`/configs/${slug}`, { body, ...opts }); + return response; + } + list( + _body: ApiKeysListParams, + params?: ApiClientInterface, + opts?: RequestOptions + ):APIPromise{ + const body = _body; + if (params) { + this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } + } + const query = toQueryParams(body); + const response = this.get('/configs', { body, ...opts }); + return response; + } +} diff --git a/src/apis/index.ts b/src/apis/index.ts index a127a15..5200607 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -17,4 +17,5 @@ export { Moderations } from "./moderations" export { Audio } from "./audio" export { VectorStores } from "./vectorStores" export { BetaChat } from "./betaChat" -export { Uploads } from "./uploads" \ No newline at end of file +export { Uploads } from "./uploads" +export { ApiKeys } from "./apiKeys" \ No newline at end of file diff --git a/src/client.ts b/src/client.ts index e490e4d..c66d6b5 100644 --- a/src/client.ts +++ b/src/client.ts @@ -144,6 +144,7 @@ export class Portkey extends ApiClient { audio = new API.Audio(this); uploads = new API.Uploads(this); admin = new API.Admin(this); + apiKeys = new API.ApiKeys(this); beta = { assistants: new API.Assistants(this), threads: new API.Threads(this), @@ -151,7 +152,6 @@ export class Portkey extends ApiClient { chat: new API.BetaChat(this), }; - post = ( url: string, _body: PostBodyParams, From a80a0c8f5cee55fe23e67347c60f67748751bd49 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 30 Sep 2024 15:15:00 +0530 Subject: [PATCH 02/11] feat: add api-keys endpoint --- src/apis/apiKeys.ts | 93 +++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 24 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index 6d65558..cd3f4c6 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -4,45 +4,75 @@ import { APIPromise, RequestOptions } from "../baseClient"; import { createHeaders } from "./createHeaders"; export interface ApiKeysCreateParams { - name: string; - config: Record; - isDefault: number; - workspace_id:string; + type?: string; + "sub-type"?: string; + name?: string; + description?: string; + workspace_id?:string; + user_id?:string; + rate_limits?: Record[]; + usage_limits?: Record; + scopes: string[]; + defaults?: Record; } export interface ApiKeysRetrieveParams { - slug: string; + id?: string; } export interface ApiKeysUpdateParams { - slug?: string; + id?: string; name?: string; - config?: Record; - status?: string; + description?: string; + rate_limits?: Record[]; + usage_limits?: Record; + scopes?: string[]; + defaults?: Record; } export interface ApiKeysListParams { page_size?: number; current_page?: number; workspace_id?: string; } - +export interface ApiKeysDeleteParams { + id?: string; +} export interface ApiKeysCreateResponse extends APIResponseType { - success: boolean; - data: Record; + id?: string; + key?: string; + object?: string; } export interface ApiKeysRetrieveResponse extends APIResponseType { - success: boolean; - data: Record; + id?: string; + key?: string; + name?: string; + description?: string; + type?: string; + organisation_id?: string; + workspace_id?: string; + user_id?: string; + status?: string; + created_at?: Date; + last_updated_at?: Date; + creation_mode?: string; + rate_limits?: Record[]; + usage_limits?: Record; + reset_usage?:number; + scopes?: string[]; + defaults?: Record; + object?: string; } export interface ApiKeysListResponse extends APIResponseType { - sucess: boolean; - data: Record[]; + total?: number; + object?: string; + data?: Record[]; } export interface ApiKeysUpdateResponse extends APIResponseType { - success: boolean; - data: Record; + object?: string; + total?:number; + data?: Record[]; } -function toQueryParams(params?: ApiKeysListResponse): string { +function toQueryParams(params?: ApiKeysListParams): string { if (!params) { return ''; } @@ -63,10 +93,12 @@ export class ApiKeys extends ApiResource { opts?: RequestOptions ): APIPromise { const body = _body; + const type = body.type; + const subType = body["sub-type"]; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.post('/configs', { body, ...opts }); + const response = this.post(`/api-keys/${type}/${subType}`, { body, ...opts }); return response; } @@ -76,11 +108,11 @@ export class ApiKeys extends ApiResource { opts?: RequestOptions ): APIPromise { const body = _body; - const slug = body.slug; + const id = body.id; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.get(`/configs/${slug}`, { body, ...opts }); + const response = this.get(`/api-keys/${id}`, { body, ...opts }); return response; } @@ -90,11 +122,11 @@ export class ApiKeys extends ApiResource { opts?: RequestOptions ): APIPromise { const body = _body; - const slug = body.slug; + const id = body.id; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.put(`/configs/${slug}`, { body, ...opts }); + const response = this.put(`/api-keys/${id}`, { body, ...opts }); return response; } list( @@ -107,7 +139,20 @@ export class ApiKeys extends ApiResource { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } const query = toQueryParams(body); - const response = this.get('/configs', { body, ...opts }); + const response = this.get(`/api-keys${query}`, { body, ...opts }); + return response; + } + delete( + _body: ApiKeysDeleteParams, + params?: ApiClientInterface, + opts?: RequestOptions + ):APIPromise{ + const body = _body; + const id=body.id; + if (params) { + this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } + } + const response = this.deleteMethod(`/api-keys/${id}`, { body, ...opts }); return response; } } From a5abb538f61d393c364513631939019a73893e60 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Thu, 3 Oct 2024 20:26:04 +0530 Subject: [PATCH 03/11] fix: get methods of api-keys have been fixed --- src/apis/apiKeys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index cd3f4c6..2f0f96e 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -112,7 +112,7 @@ export class ApiKeys extends ApiResource { if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.get(`/api-keys/${id}`, { body, ...opts }); + const response = this.get(`/api-keys/${id}`, { ...opts }); return response; } @@ -139,7 +139,7 @@ export class ApiKeys extends ApiResource { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } const query = toQueryParams(body); - const response = this.get(`/api-keys${query}`, { body, ...opts }); + const response = this.get(`/api-keys${query}`, {...opts }); return response; } delete( From 5ad3ccf754fbc191e54c29fdb311fb8acc72249b Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 12:02:25 +0530 Subject: [PATCH 04/11] fix: method names have been changed to get, add --- src/apis/apiKeys.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index 2f0f96e..163d034 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -3,7 +3,7 @@ import { APIResponseType, ApiClientInterface } from "../_types/generalTypes"; import { APIPromise, RequestOptions } from "../baseClient"; import { createHeaders } from "./createHeaders"; -export interface ApiKeysCreateParams { +export interface ApiKeysAddParams { type?: string; "sub-type"?: string; name?: string; @@ -16,7 +16,7 @@ export interface ApiKeysCreateParams { defaults?: Record; } -export interface ApiKeysRetrieveParams { +export interface ApiKeysGetParams { id?: string; } @@ -37,12 +37,12 @@ export interface ApiKeysListParams { export interface ApiKeysDeleteParams { id?: string; } -export interface ApiKeysCreateResponse extends APIResponseType { +export interface ApiKeysAddResponse extends APIResponseType { id?: string; key?: string; object?: string; } -export interface ApiKeysRetrieveResponse extends APIResponseType { +export interface ApiKeysGetResponse extends APIResponseType { id?: string; key?: string; name?: string; @@ -87,32 +87,32 @@ export class ApiKeys extends ApiResource { constructor(client: any) { super(client); } - create( - _body: ApiKeysCreateParams, + add( + _body: ApiKeysAddParams, params?: ApiClientInterface, opts?: RequestOptions - ): APIPromise { + ): APIPromise { const body = _body; const type = body.type; const subType = body["sub-type"]; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.post(`/api-keys/${type}/${subType}`, { body, ...opts }); + const response = this.post(`/api-keys/${type}/${subType}`, { body, ...opts }); return response; } - retrieve( - _body: ApiKeysRetrieveParams, + get( + _body: ApiKeysGetParams, params?: ApiClientInterface, opts?: RequestOptions - ): APIPromise { + ): APIPromise { const body = _body; const id = body.id; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.get(`/api-keys/${id}`, { ...opts }); + const response = this.getMethod(`/api-keys/${id}`, { ...opts }); return response; } @@ -139,7 +139,7 @@ export class ApiKeys extends ApiResource { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } const query = toQueryParams(body); - const response = this.get(`/api-keys${query}`, {...opts }); + const response = this.getMethod(`/api-keys${query}`, {...opts }); return response; } delete( From eb949858b500cb3d83f9933ad40d9628a4eb27db Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 14:37:41 +0530 Subject: [PATCH 05/11] fix: re-arranged the interfaces of ApiKeys --- src/apis/apiKeys.ts | 51 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index 163d034..e308849 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -15,33 +15,14 @@ export interface ApiKeysAddParams { scopes: string[]; defaults?: Record; } - -export interface ApiKeysGetParams { - id?: string; -} - -export interface ApiKeysUpdateParams { - id?: string; - name?: string; - description?: string; - rate_limits?: Record[]; - usage_limits?: Record; - scopes?: string[]; - defaults?: Record; -} -export interface ApiKeysListParams { - page_size?: number; - current_page?: number; - workspace_id?: string; -} -export interface ApiKeysDeleteParams { - id?: string; -} export interface ApiKeysAddResponse extends APIResponseType { id?: string; key?: string; object?: string; } +export interface ApiKeysGetParams { + id?: string; +} export interface ApiKeysGetResponse extends APIResponseType { id?: string; key?: string; @@ -62,16 +43,34 @@ export interface ApiKeysGetResponse extends APIResponseType { defaults?: Record; object?: string; } -export interface ApiKeysListResponse extends APIResponseType { - total?: number; - object?: string; - data?: Record[]; +export interface ApiKeysUpdateParams { + id?: string; + name?: string; + description?: string; + rate_limits?: Record[]; + usage_limits?: Record; + scopes?: string[]; + defaults?: Record; } export interface ApiKeysUpdateResponse extends APIResponseType { object?: string; total?:number; data?: Record[]; } +export interface ApiKeysListParams { + page_size?: number; + current_page?: number; + workspace_id?: string; +} +export interface ApiKeysListResponse extends APIResponseType { + total?: number; + object?: string; + data?: Record[]; +} +export interface ApiKeysDeleteParams { + id?: string; +} + function toQueryParams(params?: ApiKeysListParams): string { if (!params) { return ''; From 210fbd754dd2ec04d71bb08daa28322ab97bf435 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 16:39:48 +0530 Subject: [PATCH 06/11] fix: "unknown" type changed to "any" --- src/apis/apiKeys.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index e308849..35fe4ef 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -10,10 +10,10 @@ export interface ApiKeysAddParams { description?: string; workspace_id?:string; user_id?:string; - rate_limits?: Record[]; - usage_limits?: Record; + rate_limits?: Record[]; + usage_limits?: Record; scopes: string[]; - defaults?: Record; + defaults?: Record; } export interface ApiKeysAddResponse extends APIResponseType { id?: string; @@ -36,26 +36,26 @@ export interface ApiKeysGetResponse extends APIResponseType { created_at?: Date; last_updated_at?: Date; creation_mode?: string; - rate_limits?: Record[]; - usage_limits?: Record; + rate_limits?: Record[]; + usage_limits?: Record; reset_usage?:number; scopes?: string[]; - defaults?: Record; + defaults?: Record; object?: string; } export interface ApiKeysUpdateParams { id?: string; name?: string; description?: string; - rate_limits?: Record[]; - usage_limits?: Record; + rate_limits?: Record[]; + usage_limits?: Record; scopes?: string[]; - defaults?: Record; + defaults?: Record; } export interface ApiKeysUpdateResponse extends APIResponseType { object?: string; total?:number; - data?: Record[]; + data?: Record[]; } export interface ApiKeysListParams { page_size?: number; @@ -65,7 +65,7 @@ export interface ApiKeysListParams { export interface ApiKeysListResponse extends APIResponseType { total?: number; object?: string; - data?: Record[]; + data?: Record[]; } export interface ApiKeysDeleteParams { id?: string; From f39fe096e39dea7716be584a7fdf5a076932a2b8 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 17:29:27 +0530 Subject: [PATCH 07/11] fix: utils.ts updated with toQueryParams --- src/apis/apiKeys.ts | 13 +------------ src/utils.ts | 5 +++-- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index 35fe4ef..d951fbb 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -2,6 +2,7 @@ import { ApiResource } from "../apiResource"; import { APIResponseType, ApiClientInterface } from "../_types/generalTypes"; import { APIPromise, RequestOptions } from "../baseClient"; import { createHeaders } from "./createHeaders"; +import { toQueryParams } from "portkey-ai/utils"; export interface ApiKeysAddParams { type?: string; @@ -70,18 +71,6 @@ export interface ApiKeysListResponse extends APIResponseType { export interface ApiKeysDeleteParams { id?: string; } - -function toQueryParams(params?: ApiKeysListParams): string { - if (!params) { - return ''; - } - const queryParams = Object.entries(params) - .filter(([, value]) => value !== undefined && value !== null) - .map(([key, value]) => `${key}=${value}`) - .join('&'); - - return queryParams ? `?${queryParams}` : ''; -} export class ApiKeys extends ApiResource { constructor(client: any) { super(client); diff --git a/src/utils.ts b/src/utils.ts index 8f31ba8..6b48da4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,6 +3,7 @@ import { createResponseHeaders } from "./streaming"; import OpenAI from "openai"; import type { Portkey } from "./index"; import { UserInviteListParams, UsersListParams, WorkspaceMemberListParams, WorkspacesListParams } from "./apis/admin"; +import { ApiKeysListParams } from "./apis/apiKeys"; type PlatformProperties = { "x-portkey-runtime"?: string, @@ -131,7 +132,7 @@ export function initOpenAIClient(client: Portkey){ maxRetries: 0 }) } -export function toQueryParams(params?: (UsersListParams | UserInviteListParams | WorkspacesListParams | WorkspaceMemberListParams)): string { +export function toQueryParams(params?: (UsersListParams | UserInviteListParams | WorkspacesListParams | WorkspaceMemberListParams | ApiKeysListParams)): string { if (!params) { return ''; } @@ -141,4 +142,4 @@ export function toQueryParams(params?: (UsersListParams | UserInviteListParams | .join('&'); return queryParams ? `?${queryParams}` : ''; -} \ No newline at end of file +} From 6057d30fbc91f6fdc3f5ff972c2f54200462f102 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 18:41:41 +0530 Subject: [PATCH 08/11] fix: import statement fixed --- src/apis/apiKeys.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index d951fbb..f76cbaf 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -2,7 +2,7 @@ import { ApiResource } from "../apiResource"; import { APIResponseType, ApiClientInterface } from "../_types/generalTypes"; import { APIPromise, RequestOptions } from "../baseClient"; import { createHeaders } from "./createHeaders"; -import { toQueryParams } from "portkey-ai/utils"; +import { toQueryParams } from "../utils"; export interface ApiKeysAddParams { type?: string; From d04c4698298707bab87e9e94be8d23ca10085200 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Mon, 7 Oct 2024 21:29:56 +0530 Subject: [PATCH 09/11] fix: ApiKeyUpdateResponse Interface has been removed --- src/apis/apiKeys.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index f76cbaf..7bec05f 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -53,11 +53,6 @@ export interface ApiKeysUpdateParams { scopes?: string[]; defaults?: Record; } -export interface ApiKeysUpdateResponse extends APIResponseType { - object?: string; - total?:number; - data?: Record[]; -} export interface ApiKeysListParams { page_size?: number; current_page?: number; @@ -108,13 +103,13 @@ export class ApiKeys extends ApiResource { _body: ApiKeysUpdateParams, params?: ApiClientInterface, opts?: RequestOptions - ): APIPromise { + ): APIPromise { const body = _body; const id = body.id; if (params) { this.client.customHeaders = { ...this.client.customHeaders, ...createHeaders({ ...params }) } } - const response = this.put(`/api-keys/${id}`, { body, ...opts }); + const response = this.put(`/api-keys/${id}`, { body, ...opts }); return response; } list( From d7f215c83d6bfbd0cb6b71a0b2ce6cf092fdf876 Mon Sep 17 00:00:00 2001 From: shivam-pareek Date: Tue, 8 Oct 2024 20:06:59 +0530 Subject: [PATCH 10/11] fix: redundant constructor has been removed --- src/apis/apiKeys.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index 7bec05f..c148d44 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -67,9 +67,6 @@ export interface ApiKeysDeleteParams { id?: string; } export class ApiKeys extends ApiResource { - constructor(client: any) { - super(client); - } add( _body: ApiKeysAddParams, params?: ApiClientInterface, From bd058f95cfd7a6c5cda3c874a0d02d1cc66eb543 Mon Sep 17 00:00:00 2001 From: csgulati09 Date: Tue, 8 Oct 2024 21:15:30 +0530 Subject: [PATCH 11/11] feat: rename signature --- src/apis/apiKeys.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apis/apiKeys.ts b/src/apis/apiKeys.ts index c148d44..84ba40d 100644 --- a/src/apis/apiKeys.ts +++ b/src/apis/apiKeys.ts @@ -67,7 +67,7 @@ export interface ApiKeysDeleteParams { id?: string; } export class ApiKeys extends ApiResource { - add( + create( _body: ApiKeysAddParams, params?: ApiClientInterface, opts?: RequestOptions @@ -82,7 +82,7 @@ export class ApiKeys extends ApiResource { return response; } - get( + retrieve( _body: ApiKeysGetParams, params?: ApiClientInterface, opts?: RequestOptions