Uname: Linux webm012.cluster130.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software: Apache
PHP version: 8.0.30 [ PHP INFO ] PHP os: Linux
Server Ip: 145.239.37.162
Your Ip: 216.73.216.190
User: dreampi (1009562) | Group: users (100)
Safe Mode: OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl

name : Url.php
<?php

namespace ThemeRex\OpenAi;

class Url {

	public const ORIGIN = 'https://api.openai.com';
	public const SITE = 'https://beta.openai.com';
	public const API_VERSION = 'v1';

	/**
	 * @return string
	 */
	public static function baseURL( $endpoint = '', $type = 'api' ): string {
		return ( $type == 'api' ? self::ORIGIN . "/" . self::API_VERSION : self::SITE ) . ( ! empty( $endpoint ) ? "/{$endpoint}" : '' );
	}

	/**
	 * @param string $engine
	 * 
	 * @return string
	 * 
	 * @deprecated
	 */
	public static function completionURL( string $engine ): string {
		return self::baseURL( "engines/{$engine}/completions" );
	}

	/**
	 * @return string
	 */
	public static function completionsURL(): string {
		return self::baseURL( "completions" );
	}

	/**
	 *
	 * @return string
	 */
	public static function editsUrl(): string {
		return self::baseURL( "edits" );
	}

	/**
	 * @param string $engine
	 * 
	 * @return string
	 */
	public static function searchURL( string $engine ): string {
		return self::baseURL( "engines/{$engine}/search" );
	}

	/**
	 * @return string
	 */
	public static function enginesUrl(): string {
		return self::baseURL( "engines" );
	}

	/**
	 * @param string $engine
	 * 
	 * @return string
	 */
	public static function engineUrl( string $engine ): string {
		return self::baseURL( "engines/{$engine}" );
	}

	/**
	 * @return string
	 */
	public static function classificationsUrl(): string {
		return self::baseURL( "classifications" );
	}

	/**
	 * @return string
	 */
	public static function moderationUrl(): string {
		return self::baseURL( "moderations" );
	}

	/**
	 * @return string
	 */
	public static function speechUrl(): string {
		return self::baseURL( "audio/speech" );
	}

	/**
	 * @return string
	 */
	public static function transcriptionsUrl(): string {
		return self::baseURL( "audio/transcriptions" );
	}

	/**
	 * @return string
	 */
	public static function translationsUrl(): string {
		return self::baseURL( "audio/translations" );
	}

	/**
	 * @return string
	 */
	public static function filesUrl(): string {
		return self::baseURL( "files" );
	}

	/**
	 * @return string
	 */
	public static function fineTuneUrl(): string {
		return self::baseURL( "fine-tunes" );
	}

	/**
	 * @return string
	 */
	public static function fineTuneModel(): string {
		return self::baseURL( "models" );
	}

	/**
	 * @return string
	 */
	public static function answersUrl(): string {
		return self::baseURL( "answers" );
	}

	/**
	 * @return string
	 */
	public static function imageUrl(): string {
		return self::baseURL( "images" );
	}

	/**
	 * @return string
	 */
	public static function embeddings(): string {
		return self::baseURL( "embeddings" );
	}

	/**
	 * @return string
	 */
	public static function chatUrl(): string {
		return self::baseURL( "chat/completions" );
	}

}
© 2026 GrazzMean-Shell