ChatMotor logo

Integrate OpenAI’s API into Your Java & C# Applications with Our Free Edition

ChatMotor simplifies integration, handling HTTP requests, large data chunking, and teletype streaming.

With APIs for translation, transcription, image management, and bulk Excel processing, you can build AI-powered Java apps—without overpriced SaaS.

It also includes categorization, entity extraction, sentiment analysis, and a failover mechanism for reliability. Notify users instantly with our Notification API.

C# support coming soon!

 

 
				
					// Build a ChatMotor instance.
ChatMotor chatMotor = ChatMotor.builder().build();

String filePath ="/path/to/your/large-file.html";
String responsePath = filePath + ".translated.html";

// Build a translation request with ChatMotor.
// Works with large texts, preserving the original format when 
// rendered. (Large files are not supported by OpenAI ChatGPT).
// Large files are automatically chunked into smaller parts for 
// processing, with multi-threading enabled to speed up results.
// This process applies to all APIs, ensuring efficient 
// handling of large texts.
MotorLargeTranslationRequest translationRequest
    = MotorLargeTranslationRequest.builder()
	    .aiModel("gpt-4")
	    .chatMotor(chatMotor)
	    .filePath(filePath)
	    .languageCode("en")
	    .build();

// Execute the translation request
MotorLargeResponse response = translationRequest.execute();

// APis never throw Exceptions, never return null values.
// Built-in safety to prevent potential runtime errors.
if (response.isResponseOk()) {
    // Dump the translated text to a file
     try (InputStream in = response.getInputStream();) {
	     Files.copy(in, Paths.get(responsePath),
		     StandardCopyOption.REPLACE_EXISTING);
     }
} else {
     // Treat errors
     // See the MotorLargeResponse class for more details.
}
				
			

Don’t lose time (or your hair) building on OpenAI’s low level API’s

We’ve launched several Java apps based on ChatGPT and OpenAI. In the end, we built our own toolkit to handle OpenAI API’s as they have some shortcomings:

No built-in volume handling for some OpenAI API functions.

Hard to manage large requests and responses, especially with big datasets.

Handling raw HTTP requests and retries is error-prone and cumbersome.

No failover service if current quota is exceeded or rate limit reached.

No easy built-in mechanism for managing progressive results streaming.

OpenAI APIs lack support for some audio formats.

Wanna speed up integration of OpenAI’s API?
You’re in the right place

Looking to bring AI in your app right away, without diving in the doc?

Aiming to streamline and enhance interactions with ChatGPT’s API?

Seeking to improve customer usage of advanced OpenAI models?

Discover ChatMotor, the first API to Streamline OpenAI’s Integration

painters_palette
text_speaker
translate

COMPLETE OPENAI MAPPING & EXTENDED FUNCTIONNAL APIs

We’ve made it way easier to use each model and juggle file formats

Rich mapping of all OpenAI API’s

With ChatMotor, you’ll find it’s easy to code Text-to-Speech, Transcription, Image Generation (Dall-E 2 & 3), Vision (image to answer), and translation with rich text format (HTML, Word, PDF).

We also handles large media files with no size limits, bypassing OpenAI’s audio file limitations, ensuring smooth processing across all your AI-driven tasks.

Additionally, we provide a formatter for text transcription, so your users don’t receive output in one continuous line.

 
				
					
	// Transcription supports any format supported 
	// by FFMPEG
	String audioFile = "/path/to/your/audio/file.mp4";
	
	// Build the transcription request.
	// Large audio will be chunked to bypass the OpenAI API's 
	// limit.
	// A thread pool will be used to efficiently 
	// handle chunks for fast results.
	MotorLargeTranscriptionRequest transcriptionRequest 
	    = MotorLargeTranscriptionRequest.builder()
		.chatMotor(chatMotor)
		.filePath(audioFile)
		.timestamp(true)
		.build();

	// Execute the transcribe request.
	MotorLargeResponse largeReponse 
	    = transcriptionRequest.execute();

	// Create the transcription file.
	if (largeReponse.isResponseOk()) {
		String transcriptionFile =  audioFile + ".txt";
	    try (InputStream in = largeReponse.getInputStream()) {
		    Files.copy(in, Paths.get(transcriptionFile), 
			    StandardCopyOption.REPLACE_EXISTING);
	    }
	} else {
     // Treat errors
     // See the MotorLargeResponse class for more details.
	}
				
			
objects_transform

LARGE REQUEST CHUNKING

 

Enjoy More than OpenAI’s context window. Transform large contents.

And don’t fret about the size of your requests and responses.

No request Size Limit
ChatMotor automates request sequencing, allowing users to handle large queries without any size limitations.

No output file size limits
ChatMotor lets you bypass OpenAI’s output prompt token limitations (4K). You can chain requests and responses, and the result will be dumped and streamed into a file.

Bulk Program Your Excel Files
Wouldn’t it be nice for your end users to bulk program their Excel files using a prompt, instead of hard-to-code formulas in the cells or long-to-code Python scripts? This is now possible with MotorLargeRequestLines.

 
				
					// Build a ChatMotor instance.
ChatMotor chatMotor = ChatMotorTest.getChatMotor();

// Optionally build a MotorAiOptions instance.
MotorAiOptions options = MotorAiOptions.builder()
     // Controls the randomness of the AI responses
    .temperature(0.0) 
    // Defines the maximum number of tokens 
    // in each response
    .maxTokens(4000) 
    .build();

MotorSystemMessage motorSystemMessage = new MotorSystemMessage(
    "I will provide you with temperature measurements in Fahrenheit in a text file. "
    + "Convert the temperatures to degrees Celsius and add ';true' at the end of the line "
    + "if the temperature is above 20 degrees Celsius. "
    + "Do not add any comments and maintain the exact input format "
    + "without adding any new CR/LF characters.");

// Make a request to the ChatMotor. 
// Convert the CSV file following prompt.
MotorLargeRequestLines request 
    = MotorLargeRequestLines.builder()
    .chatMotor(chatMotor)
    .motorAiOptions(options)
    .systemMessage(motorSystemMessage)
    .filePath("/path/to/Fahrenheit.csv")
    .build();

// Execute the request.
MotorLargeResponse response = request.execute();

if (response.isResponseOk()) {
     String outFile = "/path/to/Celsius.csv";
     Path path = new File(outFile).toPath();

     try (InputStream in = response.getInputStream();) {
     Files.copy(in, path, 
        StandardCopyOption.REPLACE_EXISTING);
     }
} else {
    //Treat error
}
				
			
excavator
arrow_fork
document_heart

ADVANCED TEXT PROCESSING

Extract and analyze key insights from your text with ChatMotor’s specialized APIs

Take control of categorization, entity extraction, and sentiment analysis with ease and precision—without paying for flashy, overpriced SaaS solutions. Just do the job.

 

Categorize Text Automatically
Let ChatMotor automate content categorization for you, whether for spam filtering, content tagging, or topic detection.

Effortless Entity Extraction
Extract critical information like people, locations, and organizations from large volumes of text.

Sentiment Analysis at Scale
Understand the tone and emotion behind any text.
Analyze customer feedback, social media posts, or reviews at scale and gain sentiment insights, whether positive, negative, or neutral.

				
					String filePath = "/path/to/sentiments-sourcetxt";

// Build a ChatMotor instance.
ChatMotor chatMotor = ChatMotor.builder()
	    .build();

 // Make a Sentiment Analysis request to the ChatMotor.
 MotorSentimentRequest request
   = MotorSentimentRequest.builder()
	.chatMotor(chatMotor)
	.filePath(filePath)
	.build();
 
 if (response.isResponseOk()) {
     System.out.println("response: ");
     MotorSentiment motorSentiment 
       = response.getMotorSentiment();
     SentimentType sentiment 
       = motorSentiment.sentiment();
     
     // POSITIVE, NEGATIVE,
     // NEUTRAL
     System.out.println("sentiment : " + sentiment); 
     
     // Confidence scores for each sentiment type.
     // Ex: ConfidenceScores [positive=85, negative=10, 
     // neutral=5]
     System.out.println("scores    : "
       + motorSentiment.getConfidenceScores());
 } else {
     System.out.println("throwable   : " 
       + response.getThrowable());
 }

	 
 
 
 
 
				
			
earth_network
repeat
alarmclock

TRANSPARENT HTTP HANDLING & OPENAI QUOTAS

Just code what you want to happen.
Don’t worry about managing HTTP requests

Automatic Retry in Case of Error
ChatMotor handles HTTP requests automatically and offers retry functionality with capping and delay management. This ensures robust and reliable communication, reducing the likelihood of errors disrupting operations.

Failover Management
If your account exceeds its quota or hits the rate limit, ChatMotor ensures continuity with a failover mechanism. A secondary OpenAI key will be used automatically if the primary key fails.

Thread Timeout Management
ChatMotor allows you to set a timeout for API requests to ensure efficient resource management and prevent indefinite blocking, maintaining the responsiveness of your application.

				
						// Define the max number of retries for the API requests 
	// and the retry interval between API request retries
	int maxRetries = 4;
	Duration retryInterval = Duration.ofMillis(4000);
	
	// Define a failover API key to be automatically 
	// used in case the primary API key fails
	String failoverApiKey = "[the failover api key]";
	
	// Define the timeout for the API requests threads
	Duration timeout = Duration.ofSeconds(200);
	
	//  Build the ChatMotor instance with all the parameters
	ChatMotor chatMotor = ChatMotor.builder()
		   .maxRetries(maxRetries)
		   .retryInterval(retryInterval)
		   .failoverApiKey(failoverApiKey)
		   .timeout(timeout)
		   .build();
		   
	// Build a transcription request.
	MotorTranscriptionRequest request = 
	   MotorTranscriptionRequest.builder()
		.chatMotor(chatMotor)
		.filePath("/path/to/audio/file.mp3")
		.build();

	// Execute the transcribe request.
	MotorLargeResponse largeReponse = request.execute();
	// Etc...
 
				
			
text_field

EASY OPENAI STREAMING

Teletype like ChatGPT. It’s as easy as accessing your Java Reader

Progressive display of results
ChatMotor allows easy progressive display of responses, akin to the ChatGPT browser version.
The stream may be redirected to a File, a Queue, a Swing component, etc.

				
					 // Build a request to the ChatMotor.
 MotorRequest motorRequest = MotorRequest.builder()
    .chatMotor(chatMotor)
    .messages(motorMessages)
    .build();
 
 // Execute the request and display immediately 
 // the response in the console.
 // This uses a dedicated listener for println.
 MotorResponseListener listener = 
    new ConsoleResponseListener();
 MotorStreamStatus status =
    motorRequest.executeAsStream(listener);
				
			
mobile_phone3
mail_out
user_message

REAL-TIME NOTIFICATIONS & DOCUMENT DELIVERY

 

Keep your users informed and engaged with ChatMotor’s Notification API

Instant User Notifications
Automatically notify users the moment their document is ready for download or review. No more manual follow-ups—just seamless communication.

Multi-Channel Document Delivery
Send documents directly to users through their preferred channel, including SMS (via Twilio), Slack, or Email. Choose what works best for your workflow and users. 

Asynchronous or Synchronous
Whether you need immediate feedback or prefer asynchronous execution, ChatMotor gives you the flexibility to notify or send documents on your schedule.

Built for Growth
Easily extend the Notification API to new platforms, from Notion to Airtable or your internal systems. Create your own custom communication channels effortlessly.

 
 
				
					String token = "[Slak Token]"; 
String channel = "[Slak Channel ID]"; 

String filePath = "/path/to/your/ai-treated-file.txt";

// Build a ChatMotor instance.
ChatMotor chatMotor = ChatMotor.builder().build();

// Create a NotificationChannel with the 
// Slack implementation
NotificationChannel notificationChannel 
    = new SlackNotificationChannel.Builder()
	    .chatMotor(chatMotor)
        .token(token)
        .channel(channel)
        .build();

// Define the execution mode for the messages or files
ExecutionMode executionMode = ExecutionMode.SYNC;

// Send a notification message Slack channel
String message = "Your AI processed document is ready!";
MotorNotifyResponse motorNotifyResponse 
= notificationChannel.notifyDocumentAvailable(message, 
        executionMode);

// And/Or send a file to Slack channel
motorNotifyResponse 
    = notificationChannel.dispatchDocument(filePath
        executionMode);

// Handle the send file response
if (motorNotifyResponse.isResponseOk()) {
    System.out.println("File has been sent successfully.");
}
else {
    System.out.println("Failed to send file: " 
        + "Error: " + motorNotifyResponse.getThrowable());
}

				
			
shield
message
motorcycle_helmet

ERROR MANAGEMENT

Handle Errors Gracefully. Decode OpenAI Error Messages. Never Get Null Values.

 

No Exceptions Thrown
ChatMotor requests don’t throw exceptions, making it easy to manage errors without disrupting your application’s flow.

Detailed Error Messages
We decode OpenAI error messages, providing comprehensive details for effective troubleshooting.

No Null Values Returned
We ensure that methods never return null values, providing default values to maintain predictable and robust behavior.

				
					// Execute the translation request (see code above)
MotorLargeResponse response = translationRequest.execute();

if (response.isResponseOk()) {
    // Treat response here.
} else {

    OpenAiError openAiError = response.getOpenAiError();
    OpenAiErrorType errorType = openAiError.getType();

    if (errorType != OpenAiErrorType.NO_OPENAI_ERROR) {
    	System.out.println("OpenAI has returned an error : " 
    		+ openAiError);
    
    	// Take specific action depending on the error code:
    	if (errorType.equals(OpenAiErrorType.SERVER_ERROR)) {
    	    // ...
    	} else if (errorType.equals(OpenAiErrorType.TOKENS)) {
    	    // ..
    	} else {
    	    // Etc.
    	}

    } else {
	    System.out.println("throwable   : " 
		    + response.getThrowable());
    }
}

				
			

You think Java’s good, but C# would be even better?

We’ve got you covered!
ChatMotor for C# is coming soon in private Beta.

Of course, no spam or other unpleasantness.

Logo_C_sharp.svg
openai-logo

Access the power of OpenAI in your code in minutes with ChatMotor

clock

Enhanced Efficiency. No time wasted.
By simplifying the management of requests and answers, ChatMotor API enables developers to focus on building engaging conversational experiences. Without being bogged down by technical complexities.

repeat

Improved Reliability. Hassle-free production.
With automatic retry functionality, ChatMotor enhances the reliability of interactions with the ChatGPT API, ensuring uninterrupted service even in the face of temporary communication issues.

document_gear

Flexibility. Scalability. Say bye to limitations.
By removing prompt size limitations and by automating sequencing, ChatMotor enables flexible and scalable integration of OpenAI. This lets businesses adapt and grow conversational AI applications effortlessly.

install

Easy installation & programming.
With our clear and complete Javadoc, user guide and code samples, get started and coding in minutes. You can go to market faster with bullet proof code – which rocks for your users and customers!

Wanna push OpenAI’s API to production quickly?
Then, what are you waiting for!?

ChatMotor takes care of all HTTP handling, large requests chucking and teletype streaming, so you can push new Java/C# applications based on conversational AI effortlessly.

Companies that already use ChatMotor 

Welcome to ChatMotor API:
Elevate Your Java Applications with Advanced AI Capabilities

We provide easy to use Java APis for ChatGPT and OpenAI.

Welcome to ChatMotor API, your comprehensive solution for integrating the powerful capabilities of ChatGPT into your Java applications. Designed to streamline the integration process, ChatMotor API offers:

  • Seamless Data Management: Efficient handling of streaming data with automatic retry mechanisms and easy timeout setups
  • Unlimited Input Prompt Size: No restrictions on input prompt size, with automatic sequencing for prompts exceeding 4000 tokens.
  • Advanced Features: Includes summarization, strategic summaries, content extraction, and filtering.
  • Enhanced AI Functionalities: Offers transcription of audio formats (except dss), text-to-speech conversion, and vision calls for text generation from images.
  • Developer-Friendly: Ideal for both beginners and experienced developers, providing the tools and resources needed to enhance applications with advanced AI capabilities.
  • Purpose-Driven Design: Allows ChatGPT API application developers to focus on what they want to achieve without worrying about the technical details of how to implement it.

 

Explore the power of ChatMotor API and elevate your Java applications with cutting-edge AI functionalities.