Ok, I got it working.
For some reasong, the original .htaccess file on the api directory was missing. It's on the original zip file, so If you're missing it, you can use this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.*/api)
RewriteRule ^(.*)$ %1/http.php/$1
</IfModule>
The URLs for accessing the api are api/tickets.xml, api/tickets.json and so.
The API Key must be provided on the X-API-Key HTTP header, as pointed out on a comment on the API code.
Here's a full working PHP example. Please notice CURL is needed for this to work (just install package php5-curl on debian, ubuntu). Remember to set the API key and the URL properly.
<?php
$api_url = 'http://localhost/api/tickets.xml';
$petition = <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<ticket alert="true" autorespond="true" source="API">
<name>Angry User</name>
<email>api@osticket.com</email>
<subject>Testing API</subject>
<phone ext="123">318-555-8634</phone>
<message><!<!<C><s>```</s>[CDATA>></message>
<attachments>
<file name="file.txt" type="text/plain"><!<![CDATA<e>```</e></C>>></file>
<file name="image.gif" type="image/gif" encoding="base64">
R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAwAAAC8IyPqcvt3wCcDkiLc7C0qwy
GHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFzByTB10QgxOR0TqBQejhRNzOfkVJ
+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSpa/TPg7JpJHxyendzWTBfX0cxOnK
PjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJlZeGl9i2icVqaNVailT6F5iJ90m6
mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uisF81M1OIcR7lEewwcLp7tuNNkM3u
Nna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PHhhx4dbgYKAAA7
</file>
</attachments>
<ip>123.211.233.122</ip>
</ticket>
EOF;
$headers = array("X-API-Key: FF513FFF42EAAFFFB5783E926A1CFFFF");
$ch = curl_init( $api_url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $petition);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
echo $response = curl_exec( $ch );
?>